Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-5273

Problem handling connections from multiple AMQP clients in ActiveMQ

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 5.10.0
    • 5.11.0
    • AMQP

    Description

      When multiple AMQP clients try to connect to the broker at exactly the same time, the broker can end up in a state where it gets an AMQP parsing error during the connection handshake and then all future AMQP connections fail until the broker is stopped. This was reproduced with C proton clients and QPID JMS clients but it seemed to depend on the speed of the machine where the broker was running and the network speed to ensure that the timing window would be hit. Turning on remote debugging in the ActiveMQ startup script made it happen much more frequently. The QPID JMS clients end up staying hung in the ConnectionEndpoint.open function and the C proton clients return a SASL error. Code analysis in the broker appeared to point to an incorrect use of static for the list data structure in the AMQPProtocolDiscriminator class. I am planning to attach a patch and unit test that demonstrate the behavior as well as some logs. The unit test fails with a "timeout" as all of the threads get hung when attempting to make connection and seems to require the following MAVEN_OPTS to be set to see it fail consistently:
      export MAVEN_OPTS="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

      When running the broker in console mode, the following would be output for each failed client connection attempt:
      Could not decode AMQP frame: hex: 0000002102010000005341d00000001100000002a309414e4f4e594d4f5553a000

      Attachments

        1. AMQ5273Test.java
          5 kB
          Jesse Fugitt
        2. amqp_connection_race.patch
          0.8 kB
          Jesse Fugitt
        3. org.apache.activemq.transport.amqp.AMQ5273Test-output.txt
          9 kB
          Jesse Fugitt

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jfugitt Jesse Fugitt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: