You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/10/17 00:38:38 UTC

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3792: ARTEMIS-3528 only enable JVM debug options for 'run' command

jbertram commented on a change in pull request #3792:
URL: https://github.com/apache/activemq-artemis/pull/3792#discussion_r729957284



##########
File path: artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
##########
@@ -30,30 +30,33 @@ ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
 # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
 #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
 
-
 # Hawtio Properties
 HAWTIO_ROLE='${role}'
 
-
 # Java Opts
 if [ -z "$JAVA_ARGS" ]; then
     JAVA_ARGS="-XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml ${java-opts}"
-fi
 
-#
-# Logs Safepoints JVM pauses: Uncomment to enable them
-# In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could
-# affect the latencies of the services delivered by the broker, including those that are not reported by the classic GC logs
-# and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted loops and obviously GC activity).
-# Replace "all_pauses.log" with the file name you want to log to.
-# JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
+    # Uncomment to enable logging for Safepoint JVM pauses
+    #
+    # In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause
+    # that could affect the latencies of the services delivered by the broker, including those that are not reported by
+    # the classic GC logs and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted
+    # loops and obviously GC activity).
+    #
+    # Replace "all_pauses.log" with the file name you want to log to.
+    # JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"

Review comment:
       I assumed that if a user was supplying their own `JAVA_ARGS` then they could set their own values for this. I've reverted this changed in my latest commit.

##########
File path: artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
##########
@@ -30,30 +30,33 @@ ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
 # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
 #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
 
-
 # Hawtio Properties
 HAWTIO_ROLE='${role}'
 
-
 # Java Opts
 if [ -z "$JAVA_ARGS" ]; then
     JAVA_ARGS="-XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml ${java-opts}"
-fi
 
-#
-# Logs Safepoints JVM pauses: Uncomment to enable them
-# In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could
-# affect the latencies of the services delivered by the broker, including those that are not reported by the classic GC logs
-# and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted loops and obviously GC activity).
-# Replace "all_pauses.log" with the file name you want to log to.
-# JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
+    # Uncomment to enable logging for Safepoint JVM pauses
+    #
+    # In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause
+    # that could affect the latencies of the services delivered by the broker, including those that are not reported by
+    # the classic GC logs and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted
+    # loops and obviously GC activity).
+    #
+    # Replace "all_pauses.log" with the file name you want to log to.
+    # JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
+
+    # Uncomment to enable the dumping of the Java heap when a java.lang.OutOfMemoryError exception is thrown
+    # JAVA_ARGS="$JAVA_ARGS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${ARTEMIS_OOME_DUMP}"

Review comment:
       See my comment above.

##########
File path: artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
##########
@@ -30,30 +30,33 @@ ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
 # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
 #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
 
-
 # Hawtio Properties
 HAWTIO_ROLE='${role}'
 
-
 # Java Opts
 if [ -z "$JAVA_ARGS" ]; then
     JAVA_ARGS="-XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml ${java-opts}"
-fi
 
-#
-# Logs Safepoints JVM pauses: Uncomment to enable them
-# In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could
-# affect the latencies of the services delivered by the broker, including those that are not reported by the classic GC logs
-# and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted loops and obviously GC activity).
-# Replace "all_pauses.log" with the file name you want to log to.
-# JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
+    # Uncomment to enable logging for Safepoint JVM pauses
+    #
+    # In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause
+    # that could affect the latencies of the services delivered by the broker, including those that are not reported by
+    # the classic GC logs and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted
+    # loops and obviously GC activity).
+    #
+    # Replace "all_pauses.log" with the file name you want to log to.
+    # JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
+
+    # Uncomment to enable the dumping of the Java heap when a java.lang.OutOfMemoryError exception is thrown
+    # JAVA_ARGS="$JAVA_ARGS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${ARTEMIS_OOME_DUMP}"
+fi
 
-#
-# Enables the dumping of the java heap when a java.lang.OutOfMemoryError exception is thrown.
-# JAVA_ARGS="$JAVA_ARGS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${ARTEMIS_OOME_DUMP}"
 
-# Debug args: Uncomment to enable debug
-#DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+# Only enable debug options for the 'run' command
+if [ "$1" = "run" ]; then
+    # Uncomment to enable remote debugging
+    # DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"

Review comment:
       It's possible that one might want to debug the actual command rather than the broker, but I think this is likely very rare. Users are almost always going to want to debug the broker itself. I don't think it's worth adding complexity here for such a rare use-case.




-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org