arup-chauhan opened a new pull request, #5051: URL: https://github.com/apache/solr/pull/5051
## Description The Solr 9.x JMH launcher passes `-XX:-UseBiasedLocking` unconditionally. This change includes the flag only below JDK 15, preserving the existing setting on older JDKs while avoiding an unnecessary or obsolete option on newer JDKs. This PR targets `branch_9x`. Main already removed the flag when moving to Java 21. ## Changes Modified `solr/benchmark/jmh.sh`: - Detect the benchmark JVM's major version, including explicit `-jvm` overrides. - Include `-XX:-UseBiasedLocking` only below JDK 15. - Skip the version probe for help, listing commands, and explicit non-forked runs (`-f 0`). - Report version-detection failures clearly. JMH still performs its own JVM validation; an invalid `-jvm` path can therefore fail inside JMH even with `-f 0`. ## Validation - `bash -n solr/benchmark/jmh.sh` - `git diff --check` - `./gradlew check -x test` - Local launcher checks covering version parsing, the JDK 14/15 boundary, JVM overrides with spaces, and invalid version output. - Real short `RequestWriters.writeUpdate` benchmark forks on JDK 11.0.32.1 and JDK 21.0.8: confirmed the flag was included on 11 and omitted on 21. - After adding the probe-skipping logic: actual JMH help and listing commands with an invalid JVM override, a successful non-forked benchmark, and simulated forked version-selection checks. The short benchmark runs verify startup, not comparative performance. No permanent test files were added. ## AI assistance Code and PR description generated with OpenAI Codex and personally reviewed by me. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
