You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ed...@apache.org on 2021/03/19 21:39:38 UTC

[cassandra] branch trunk updated: Add io.netty.tryReflectionSetAccessible=true to j11 server options in order to enable netty to use Unsafe direct byte buffer construction Patch by Sam Tunnicliffe; reviewed by Brandon Williams, Ekaterina Dimitrova and Berenguer Blasi for CASSANDRA-16493

This is an automated email from the ASF dual-hosted git repository.

edimitrova pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new dd6c261  Add io.netty.tryReflectionSetAccessible=true to j11 server options in order to enable netty to use Unsafe direct byte buffer construction Patch by Sam Tunnicliffe; reviewed by Brandon Williams, Ekaterina Dimitrova and Berenguer Blasi for CASSANDRA-16493
dd6c261 is described below

commit dd6c261119d29208f68c5037741e6390347f5c64
Author: Sam Tunnicliffe <sa...@beobal.com>
AuthorDate: Fri Mar 19 17:30:46 2021 -0400

    Add io.netty.tryReflectionSetAccessible=true to j11 server options in order to enable netty to use Unsafe direct byte buffer construction
    Patch by Sam Tunnicliffe; reviewed by Brandon Williams, Ekaterina Dimitrova and Berenguer Blasi for CASSANDRA-16493
---
 CHANGES.txt               | 1 +
 build.xml                 | 4 ++++
 conf/jvm11-server.options | 7 +++++++
 3 files changed, 12 insertions(+)

diff --git a/CHANGES.txt b/CHANGES.txt
index 4091004..6ed7b96 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0-beta5
+ * Add io.netty.tryReflectionSetAccessible=true to j11 server options in order to enable netty to use Unsafe direct byte buffer construction (CASSANDRA-16493)
  * Make cassandra-stress -node support host:port notation (CASSANDRA-16529)
  * Better handle legacy gossip application states during (and after) upgrades (CASSANDRA-16525)
  * Mark StreamingMetrics.ActiveOutboundStreams as deprecated (CASSANDRA-11174)
diff --git a/build.xml b/build.xml
index 44af243..111c267 100644
--- a/build.xml
+++ b/build.xml
@@ -213,6 +213,9 @@
       make tests stable on low resource environments, but in java 11 we need to make it unlimited
       (don't define MaxMetaspaceSize) and disable class unloading in CMS outside of a
       stop-the-world pause.
+
+      In java 11 we also need to set a system property to enable netty to use Unsafe direct byte
+      buffer construction (see CASSANDRA-16493)
     -->
     <resources id="_jvm8_test_arg_items">
       <!-- TODO see CASSANDRA-16212 - we seem to OOM non stop now after CASSANDRA-16212, so to have clean CI while this gets looked into, disabling limiting metaspace
@@ -224,6 +227,7 @@
     <pathconvert property="_jvm8_test_arg_items_concat" refid="_jvm8_test_arg_items" pathsep=" "/>
     <resources id="_jvm11_test_arg_items">
         <string>-XX:-CMSClassUnloadingEnabled</string>
+        <string>-Dio.netty.tryReflectionSetAccessible=true</string>
     </resources>
     <pathconvert property="_jvm11_test_arg_items_concat" refid="_jvm11_test_arg_items" pathsep=" "/>
     <condition property="test-jvmargs" value="${_jvm11_test_arg_items_concat}" else="${_jvm8_test_arg_items_concat}">
diff --git a/conf/jvm11-server.options b/conf/jvm11-server.options
index 5fb829f..7e78467 100644
--- a/conf/jvm11-server.options
+++ b/conf/jvm11-server.options
@@ -93,4 +93,11 @@
 # -XX:+PrintPromotionFailure            maps to 'promotion' with level 'trace'
 # -XX:PrintFLSStatistics=1              maps to 'freelist' with level 'trace'
 
+### Netty Options
+
+# On Java >= 9 Netty requires the io.netty.tryReflectionSetAccessible system property to be set to true to enable
+# creation of direct buffers using Unsafe. Without it, this falls back to ByteBuffer.allocateDirect which has
+# inferior performance and risks exceeding MaxDirectMemory
+-Dio.netty.tryReflectionSetAccessible=true
+
 # The newline in the end of file is intentional

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org