You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/10/17 00:39:01 UTC

[jira] [Work logged] (ARTEMIS-3528) Only enable JVM debug options for 'run' command

     [ https://issues.apache.org/jira/browse/ARTEMIS-3528?focusedWorklogId=665846&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-665846 ]

ASF GitHub Bot logged work on ARTEMIS-3528:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Oct/21 00:38
            Start Date: 17/Oct/21 00:38
    Worklog Time Spent: 10m 
      Work Description: 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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 665846)
    Remaining Estimate: 0h
            Time Spent: 10m

> Only enable JVM debug options for 'run' command
> -----------------------------------------------
>
>                 Key: ARTEMIS-3528
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3528
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This is what happens if I try to add a new user from the same machine where the broker instance is running in debug mode ({{etc/artemis.profile}}, DEBUG_ARGS enabled):
> {noformat}
> $ bin/artemis user add --url tcp://localhost:61616 --user admin --password admin \
>   --user-command-user foo --user-command-password foo --role amq
> ERROR: transport error 202: bind failed: Address already in use
> ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
> JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:735]{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)