Jackie-Jiang commented on code in PR #20244:
URL: https://github.com/apache/pinot/pull/20244#discussion_r4558542931


##########
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:
   Minor: please narrow the override explanation to 
`--sun-misc-unsafe-memory-access`. Native-access grants accumulate: on JDK 25, 
a later `JAVA_OPTS="--enable-native-access=java.base"` does not revoke the 
earlier `ALL-UNNAMED` grant. The same clarification applies to the PR 
description's last-value-wins statement.



-- 
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]

Reply via email to