Build: make JMH harness JDK 17-clean (module opens, configurable heap, failOnError) - #17331
Build: make JMH harness JDK 17-clean (module opens, configurable heap, failOnError)#17331vaquarkhan wants to merge 2 commits into
Conversation
Add the --add-opens set Spark 4.x needs on JDK 17 (sun.util.calendar and others), make the JMH heap configurable via -PjmhHeap (default 32g), and make failOnError configurable via -PjmhFailOnError (default true). Without the opens the read-path benchmarks throw IllegalAccessException at warm-up; at 32g the full-scale PlanningBenchmark WithStats OOMs. Defaults preserved. Closes apache#17330
|
I hit this issue while running the Spark benchmarks on JDK 17 (Corretto 17.0.19). Every read-path benchmark I Once I added I also ran into the 32g heap limit on the full-scale On JDK 17 I confirmed Stack trace from the failing run (framework frames trimmed, marked with ...; otherwise verbatim)The failing run's VM options did not include |
| '--add-opens=java.base/sun.security.action=ALL-UNNAMED', | ||
| '--add-opens=java.base/sun.util.calendar=ALL-UNNAMED', | ||
| '--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED' | ||
| ] |
There was a problem hiding this comment.
This looks like another hand-maintained copy (very similar to project.ext.extraJvmArgs) with possible maintenance drift issues in the future. Can we consolidate more robustly, to avoid falling out of sync?
There was a problem hiding this comment.
Good point, thanks. I removed the separate --add-opens list and the JMH task now reuses the central project.property('extraJvmArgs'), so there is a single source of truth and no drift. Root cause was that the jmh block assigned jvmArgs = ['-Xmx32g'] with =, so unlike the test tasks it never inherited extraJvmArgs; reusing it fixes the sun.util.calendar warm-up failure without a second list. I also dropped sun.security.krb5 and -XX:+IgnoreUnrecognizedVMOptions since extraJvmArgs already covers what the benchmarks need. -PjmhHeap and -PjmhFailOnError remain the only new knobs, defaults unchanged (32g, failOnError true). Verified on JDK 17 with ./gradlew :iceberg-core:jmhClasses, and a full Spark read-path benchmark ran to completion with this harness.
There was a problem hiding this comment.
Good point, thanks. Consolidated in fae7942: the JMH task now reuses the central project.property('extraJvmArgs') instead of a second hand-maintained list, so there is a single source of truth and no drift.
Root cause was that the jmh block assigned jvmArgs = ['-Xmx32g'] with =, so unlike the test tasks (which do jvmArgs += project.property('extraJvmArgs')) it never inherited the shared opens, which is why Spark 4.x failed at warm-up on JDK 17 (sun.util.calendar). I also dropped the speculative sun.security.krb5 and -XX:+IgnoreUnrecognizedVMOptions, since extraJvmArgs already covers everything the benchmarks need.
-PjmhHeap and -PjmhFailOnError remain the only new knobs, defaults unchanged (32g, failOnError true). Verified on JDK 17: a full Spark read-path JMH benchmark (IcebergSourceParquetEqDeleteBenchmark) ran to completion with this harness.
What
Update
jmh.gradleso the benchmark suite runs on a clean JDK 17 checkout:--add-opensset Spark 4.x needs (sun.util.calendar, nio, security, concurrent)-PjmhHeap(default preserved at32g)failOnErrorconfigurable:-PjmhFailOnError(default preserved attrue)Why
On JDK 17 the read-path benchmarks throw
IllegalAccessException(sun.util.calendar) at warm-up, and the full-scalePlanningBenchmarkWithStats OOMs at 32g. Contributors currently cannot reproduce benchmarks without local edits. See #17330.Testing
./gradlew help,./gradlew spotlessApply,./gradlew :iceberg-core:jmhClassessucceed with the updated harness32g,failOnErrortrue unless-Pflags are passed--add-opensremain inert via-XX:+IgnoreUnrecognizedVMOptionsCloses #17330