Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-524

Artemis-service is not returning correct error codes / does not detect broker failures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • A-MQ 7.0.0.ER17
    • A-MQ 7.0.0.ER15
    • None
    • None
    • Compatibility/Configuration, User Experience
    • Hide

      1) Start broker
      2) Start somehow more brokers, (no need to change ports, etc)
      3) Try to turn if off using artemis-service stop
      4) Check return code
      5) Command via artemis stop/start will at least report issue and properly

      Show
      1) Start broker 2) Start somehow more brokers, (no need to change ports, etc) 3) Try to turn if off using artemis-service stop 4) Check return code 5) Command via artemis stop/start will at least report issue and properly

      On one of our test nodes we have noticed that there are 4 running brokers.
      We remove broker instance folder before each execution of new test suite (job) in CI.

      The thing is, we rely on artemis-service more than on artemis run.
      So the situation on machine is as follows

      [0,mtoth@jaguar ~]$ ssh root@<ip>
      Last login: Mon Jan 16 07:20:02 2017 from ...
      
      [root@dhcp-126-16 ~]# ps uax |grep java
      jamq     12670  0.0  5.8 2744764 171692 ?      Sl   Jan11   6:57 java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Xbootclasspath/a:/opt/A-MQ7-7.0.0.ER14-redhat-1/lib/jboss-logmanager-2.0.3.Final-redhat-1.jar -Djava.security.auth.login.config=/opt/jboss-amq-7-i0/etc/login.config -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dartemis.instance=/opt/jboss-amq-7-i0 -Xbootclasspath/a:/opt/A-MQ7-7.0.0.ER14-redhat-1/lib/jboss-logmanager-2.0.3.Final-redhat-1.jar -Djava.security.auth.login.config=/opt/jboss-amq-7-i0/etc/login.config -classpath /opt/A-MQ7-7.0.0.ER14-redhat-1/lib/artemis-boot.jar -Dartemis.home=/opt/A-MQ7-7.0.0.ER14-redhat-1 -Dartemis.instance=/opt/jboss-amq-7-i0 -Djava.library.path=/opt/A-MQ7-7.0.0.ER14-redhat-1/bin/lib/linux-x86_64 -Djava.io.tmpdir=/opt/jboss-amq-7-i0/tmp -Ddata.dir=/opt/jboss-amq-7-i0/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/opt/jboss-amq-7-i0/etc/logging.properties org.apache.activemq.artemis.boot.Artemis run
      jamq     16424  0.0  6.3 2745024 188596 ?      Sl   Jan17   1:13 java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Xbootclasspath/a:/opt/A-MQ7-7.0.0.ER15/lib/jboss-logmanager-2.0.3.Final.jar -Djava.security.auth.login.config=/opt/jboss-amq-7-i0/etc/login.config -classpath /opt/A-MQ7-7.0.0.ER15/lib/artemis-boot.jar -Dartemis.home=/opt/A-MQ7-7.0.0.ER15 -Dartemis.instance=/opt/jboss-amq-7-i0 -Djava.library.path=/opt/A-MQ7-7.0.0.ER15/bin/lib/linux-x86_64 -Djava.io.tmpdir=/opt/jboss-amq-7-i0/tmp -Ddata.dir=/opt/jboss-amq-7-i0/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/opt/jboss-amq-7-i0/etc/logging.properties org.apache.activemq.artemis.boot.Artemis run
      jamq     28161  0.0  6.2 2745024 184568 ?      Sl   Jan14   3:35 java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Xbootclasspath/a:/opt/A-MQ7-7.0.0.ER15/lib/jboss-logmanager-2.0.3.Final.jar -Djava.security.auth.login.config=/opt/jboss-amq-7-i0/etc/login.config -classpath /opt/A-MQ7-7.0.0.ER15/lib/artemis-boot.jar -Dartemis.home=/opt/A-MQ7-7.0.0.ER15 -Dartemis.instance=/opt/jboss-amq-7-i0 -Djava.library.path=/opt/A-MQ7-7.0.0.ER15/bin/lib/linux-x86_64 -Djava.io.tmpdir=/opt/jboss-amq-7-i0/tmp -Ddata.dir=/opt/jboss-amq-7-i0/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/opt/jboss-amq-7-i0/etc/logging.properties org.apache.activemq.artemis.boot.Artemis run
      jamq     29575  0.1 14.0 3734356 415668 ?      Sl   Jan16   5:02 java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Xbootclasspath/a:/opt/A-MQ7-7.0.0.ER15/lib/jboss-logmanager-2.0.3.Final.jar -Djava.security.auth.login.config=/opt/jboss-amq-7-i0/etc/login.config -classpath /opt/A-MQ7-7.0.0.ER15/lib/artemis-boot.jar -Dartemis.home=/opt/A-MQ7-7.0.0.ER15 -Dartemis.instance=/opt/jboss-amq-7-i0 -Djava.library.path=/opt/A-MQ7-7.0.0.ER15/bin/lib/linux-x86_64 -Djava.io.tmpdir=/opt/jboss-amq-7-i0/tmp -Ddata.dir=/opt/jboss-amq-7-i0/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/opt/jboss-amq-7-i0/etc/logging.properties org.apache.activemq.artemis.boot.Artemis run
      root     30601  0.0  0.0 103320   828 pts/0    S+   14:04   0:00 grep java
      
      [root@dhcp-126-16 ~]# su - jamq
      [jamq@dhcp-126-16 ~]$ /opt/jboss-a
      jboss-amq-6/                            jboss-a-mq-6.3.0.redhat-222/            jboss-amq7-7.0.0.ER12-maven-repository/
      jboss-a-mq-6.2.1.redhat-176/            jboss-a-mq-6.3.0.redhat-224/            jboss-amq7-7.0.0.ER12-redhat-1-sources/
      jboss-a-mq-6.2.1.redhat-177/            jboss-a-mq-6.3.0.redhat-229/            jboss-amq-7-repo/
      jboss-a-mq-6.3.0.redhat-211/            jboss-amq-7/                            jboss-amq-7-src/
      
      
      [jamq@dhcp-126-16 ~]$ su jamq -c 'cd ~;/opt/A-MQ7-7.0.0.ER15/bin/artemis create  --force --nio --allow-anonymous --role=amq --user=guest --broker-security=jaas --password=guest --java-options="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false " --name=amq /opt/jboss-amq-7-i0'
      Password: 
      Creating ActiveMQ Artemis instance at: /opt/jboss-amq-7-i0
      
      Auto tuning journal ...
      done! Your system can make 6.25 writes per millisecond, your journal-buffer-timeout will be 160000
      
      You can now start the broker by executing:  
      
         "/opt/jboss-amq-7-i0/bin/artemis" run
      
      Or you can run the broker in the background using:
      
         "/opt/jboss-amq-7-i0/bin/artemis-service" start
      
      
      [jamq@dhcp-126-16 ~]$ /opt/jboss-amq-7-i0/bin/artemis stop
      Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
      	java.net.BindException: Address already in use (Bind failed)
      
      
      [jamq@dhcp-126-16 ~]$ /opt/jboss-amq-7-i0/bin/artemis-service stop
      Gracefully Stopping artemis-service
      [jamq@dhcp-126-16 ~]$ echo $?
      0
      
      [jamq@dhcp-126-16 ~]$ /opt/jboss-amq-7-i0/bin/artemis stop
      Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
      	java.net.BindException: Address already in use (Bind failed)
      [jamq@dhcp-126-16 ~]$ echo $?
      1
      

              gaohoward Howard Gao
              mtoth@redhat.com Michal Toth
              Travis North Travis North (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: