4 Replies Latest reply on Sep 29, 2009 3:33 AM by jmesnil

    I think I found a bug (test script attached to confirm)

    mr_dronski

      Hi folks,

      Please find below a simple test script to reproduce. The symptom is after killing all client connections Queue.removeMessages() throws an error, and the only way to fix it was to restart the broker.

      import javax.management.remote.JMXConnectorFactory
      import javax.management.remote.JMXServiceURL

      def serverUrl = 'service:jmx:rmi:///jndi/rmi://192.168.12.101:3000/jmxrmi'
      println "Connecting to $serverUrl"

      def server = JMXConnectorFactory.connect(new JMXServiceURL(serverUrl)).MBeanServerConnection

      def hornetServer = new GroovyMBean(server, 'org.hornetq:type=Server,module=JMS')
      hornetServer.closeConnectionsForAddress('')
      println 'All client connections killed'

      def q = new GroovyMBean(server, 'org.hornetq:type=Queue,module=JMS,name="out"')
      q.removeMessages('')

      println 'Queue purged'

      ==================
      Output:

      Connecting to service:jmx:rmi:///jndi/rmi://192.168.12.101:3000/jmxrmi
      All client connections killed
      Caught: java.lang.Exception: did not receive reply for message org.hornetq.core.client.impl.ClientMessageImpl@1ac3fc7

      Looks like reversing the order of operations (purge, then kill connections) is the viable workaround for now.

        • 1. Re: I think I found a bug (test script attached to confirm)
          timfox

          Thanks Mr Droski-

          Can you add a JIRA and we'll be investigate?

          If you can replicate this without using the GoorvyMBean class that would be very helpful, so we can eliminate it from the enquiry.

          • 2. Re: I think I found a bug (test script attached to confirm)
            jmesnil

             

            "mr_dronski" wrote:
            def hornetServer = new GroovyMBean(server, 'org.hornetq:type=Server,module=JMS')
            hornetServer.closeConnectionsForAddress('')
            ...
            def q = new GroovyMBean(server, 'org.hornetq:type=Queue,module=JMS,name="out"')
            q.removeMessages('')
            ==================


            In HornetQ 2.0.0.Beta5, the MBeans use underneath a HornetQ connection to handle replication to the backup node.
            If you kill all the connections, it will also kill the connection used for management operations replication. Since the management operation can not be properly replicated, the error is reported to the user.

            This behavior will change for the final 2.0.0 release. Management operations replication will no longer use a HornetQ connection. Closing all connections will not prevent the management operation to be performed.

            But, in the mean time, you're right about the workaround, remove all messages from the queue before closing all the connections.

            hope that helps

            • 3. Re: I think I found a bug (test script attached to confirm)
              mr_dronski

              Thanks Jeff, you confirmed what I suspected about the implementation. Should I still file a JIRA or is this change already in a pipeline?

              • 4. Re: I think I found a bug (test script attached to confirm)
                jmesnil

                Yes, it is a good idea to file a JIRA issue to ensure the bug will be correctly fixed and verified for our next release.

                thanks,
                jeff