Repository navigation
Quiet test logs, deprecation warning per module - #5355
Conversation
…305346 java.net.URLPermission normalises a numeric IPv4 authority through java.net.HostPortrange, which formats the address with a Formatter bound to Locale.US. The "%d" conversion needs DecimalFormatSymbols, so it has to load the CLDR locale provider, and that cannot be instantiated while the policy file is still being parsed. The policy parser swallows the resulting ServiceConfigurationError, prints a warning and silently drops the entry, so the five 127.0.0.1 grants were never in effect. The [::1] grants survive only because the IPv6 branch formats with "%02x", which needs no decimal symbols. On a full parallel CI run 49 forked test JVMs each printed ten lines of this warning, 490 lines in total. No setting of java.locale.providers avoids it and granting AllPermission does not help either; the JDK bug is closed as won't-fix because the security manager is removed in JDK 24. A wildcard host parses fine and widens nothing in practice: the SocketPermission grants a few lines above still confine every connect to localhost, 127.0.0.1 and [::1].
… security manager
OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics, and the
JVM then wants to register its own JDK event classes. Without these grants the
JFR subsystem logs
[warning][jfr,system] Could not initialize JDK events. access denied
("java.lang.RuntimePermission" "accessClassInPackage.jdk.internal.event")
and carries on with no JDK events, which silently disables the JFR-sourced
jvm.system.cpu.utilization gauge that OtelRuntimeJvmMetrics deliberately
prefers over JMX.
The same three grants were added to solr/server/etc/security.policy already;
this brings the test policy in line.
With -Xlint:-deprecation javac still prints "uses or overrides a deprecated API" plus "Recompile with -Xlint:deprecation for details" as a mandatory note, and nothing suppresses it: not -nowarn, not -Xlint:none, not -Xmaxwarns 0. The only way to be rid of it is to turn the warnings on and have none left. So javac.gradle now keeps a list of projects that compile clean with -Xlint:deprecation, and :solr:api and :solr:solrj are the first two. Four @Schema(required = true) uses move to requiredMode, the hamcrest isIn matchers become in, and CloudSolrClient.getClusterState() calls go straight to the cluster state provider the deprecated method delegates to. The rest are suppressed with a reason, mostly in tests whose whole point is to cover the deprecated API. Generated request classes write to model fields that may be deprecated, so the setter in the Mustache template suppresses it too. Other modules keep the note until they are cleaned up the same way; :solr:core alone still has around 332 warnings.
setup-gradle's gradle-home-cache-includes defaults to caches and notifications only, so the wrapper's distribution directory is never saved and every job downloads the Gradle zip again, printing the download and the welcome banner.
actions/cache v4 and actions/setup-java v4 in the shared composite action were the last two still targeting Node 20, so every job was warned that the runner forces them onto a newer Node. Both majors are already in use elsewhere in the repo; this brings the composite action in line.
|
|
||
| // Configure Java project defaults. | ||
|
|
||
| // Projects that compile free of deprecation warnings and so can keep -Xlint:deprecation on. |
There was a problem hiding this comment.
I;'ve been mulling over creating a JIRA with subtasks per deprecation in hopes that folks would move on them... it's been annoying!
There was a problem hiding this comment.
Yes, and with this deprecationLintProjects someone can embrace a module, getting it deprecation free and add it to that list...
| permission "java.net.URLPermission" "https://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*"; | ||
| permission "java.net.URLPermission" "socket://127.0.0.1:*", "CONNECT:*"; | ||
| // JDK-8305346: a URLPermission with a numeric IPv4 host cannot be parsed while the policy is | ||
| // bootstrapping, so such a grant is dropped with a warning; the SocketPermissions above are what |
| @Schema(description = "The version string for this package version.", required = true) | ||
| @Schema( | ||
| description = "The version string for this package version.", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) |
| } | ||
|
|
||
| @Test | ||
| @SuppressWarnings("deprecation") // covers the deprecated ping() |
There was a problem hiding this comment.
yeah, when we deprecate something we need to be better about removing it from main so it doesn't linger.
dsmiley
left a comment
There was a problem hiding this comment.
+1
I'd rather see separate PRs per issue where a matter repeats in many places instead of one but I'm not bothered enough.
|
|
||
| // Track request counts on each node before query calls | ||
| ClusterState clusterState = cluster.getSolrClient().getClusterState(); | ||
| ClusterState clusterState = cluster.getSolrClient().getClusterStateProvider().getClusterState(); |
There was a problem hiding this comment.
this deserves a cluster.getClusterState() if there isn't one already
There was a problem hiding this comment.
There was one, but you deprecated it :)
|
Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes). Consider enabling Allow edits from maintainers so Solr maintainers can contribute to this branch (optional).
|
🤖 AI-assisted, reviewed by Jan
Five independent build/CI changes that take the bulk of the noise out of our test logs. Measured on the parallel-workflow runs of #5354 (7 workflows, 49 forked test JVMs): of 3742 lines in the Gradle-running steps, 1746 were neither task progress nor test results, and 882 of those came from five message families. For
:solr:corethe non-signal share drops from 57% to roughly 7%.java.net.HostPortrangenormalises a numeric IPv4 authority with aFormatterbound toLocale.US, whose%dconversion needs the CLDR locale provider, which cannot load while the policy file is still being parsed. The parser swallows the error, warns, and silently drops the entry, so the five127.0.0.1grants were never in effect; the[::1]ones survive only because the IPv6 branch uses%02x. That is JDK-8305346, won't-fix since the security manager goes away in JDK 24. 490 lines across the Replace Crave with parallel test workflows #5354 runs, ten per forked JVM. No value ofjava.locale.providersavoids it; a wildcard host parses cleanly and widens nothing, since theSocketPermissiongrants still confine every connect to loopback.OtelRuntimeJvmMetricsopens a JFR recording stream, and withoutregisterEvent/accessClassInPackage.jdk.{jfr.,}internal.eventthe JVM logsCould not initialize JDK events. access deniedand silently runs without the JFR-sourcedjvm.system.cpu.utilizationgauge it prefers over JMX. The same three grants are already insolr/server/etc/security.policy.uses or overrides a deprecated APInote is mandatory and unsuppressable (-nowarn,-Xlint:none,-Xmaxwarns 0all keep it). The only cure is to turn the warnings on and have none left, sojavac.gradlenow keeps a list of clean projects;:solr:apiand:solr:solrjare the first two (4 + 9 + 49 warnings fixed or suppressed with a reason). 232 lines on CI; other modules keep the note until cleaned the same way,:solr:corealone has ~332.setup-gradle'sgradle-home-cache-includesdefaults tocachesandnotifications, sowrapper/distswas never saved and all 10 jobs re-downloaded the Gradle zip, banner and progress bar included.actions/cachev4 andactions/setup-javav4 in the shared composite action were the last two, bumped to the v6 SHAs already used elsewhere in the repo.Reasoning behind silencing the deprecation logs is that we seldom act on those per test run anyway. It is more realiastic to do a targeted effort to fix deprecations once in a while.