gortiz commented on code in PR #20244: URL: https://github.com/apache/pinot/pull/20244#discussion_r4563640737
########## pinot-tools/src/main/resources/appAssemblerScriptTemplate: ########## @@ -212,7 +215,17 @@ if [ "$(jdk_version)" -gt 11 ]; then --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \ -Dio.netty.tryReflectionSetAccessible=true \ -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true \ - $JAVA_OPTS" + $ALL_JAVA_OPTS" Review Comment: Good catch, thanks. I only checked pinot-admin and missed the -Xmx1G in the jvmSettings of the start-* programs. I reverted the ALL_JAVA_OPTS change in 2c3b58f12a, so JAVA_OPTS handling is the same as on master again. The launcher fix for the dropped jvmSettings needs its own PR and a decision about the default heap. ########## pinot-tools/src/main/resources/appAssemblerScriptTemplate: ########## @@ -203,7 +203,10 @@ else ALL_JAVA_OPTS=$JAVA_OPTS fi -if [ "$(jdk_version)" -gt 11 ]; then +JDK_VERSION=$(jdk_version) Review Comment: Agreed. jdk_version now runs "$JAVACMD" (2c3b58f12a). I tested both mismatches: with PATH on JDK 21 and JAVA_HOME on JDK 25 the script adds the options, and with PATH on JDK 25 and JAVA_HOME on JDK 21 it does not and JDK 21 starts. ########## pinot-tools/src/main/resources/appAssemblerScriptTemplate: ########## @@ -212,7 +215,17 @@ if [ "$(jdk_version)" -gt 11 ]; then --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \ -Dio.netty.tryReflectionSetAccessible=true \ -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true \ - $JAVA_OPTS" + $ALL_JAVA_OPTS" +fi + +# JDK 24+ warns on sun.misc.Unsafe memory access (JEP 471), and Netty 4.2 stops using Unsafe on JDK 25+ unless the +# JVM allows it. Without Unsafe, Netty creates and closes one shared Arena per pooled chunk, which makes allocation +# and release much slower, and PlatformDependent.allocateMemory (used for buffers over 2 GB) fails. Allowing it +# also removes the JEP 471 warning from Pinot's own Unsafe-based buffers. --enable-native-access lets JNI and FFM +# libraries load without the JEP 472 warnings. JAVA_OPTS comes later on the command line, so a value set there +# overrides these. Review Comment: Right, native access grants add up. The comment and the PR description now say that only --sun-misc-unsafe-memory-access can be overridden from JAVA_OPTS, and that JAVA_OPTS cannot remove the ALL-UNNAMED grant (2c3b58f12a). -- 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]
