Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2870

CORE connection failure sometimes doesn't cleanup sessions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.10.1, 2.14.0, 2.15.0
    • 2.18.0
    • Broker
    • None

    Description

      Summary

      Since the upgrade of our deployed artemis instances from version 2.6.4 to 2.10.1 we have noticed the problem that sometimes, a connection failure doesn't include the cleanup of its connected sessions, leading to "zombie" consumers and producers on queues.

       

      The issue

      Our Artemis Clients are connected to the broker via the provided JMS abstraction, using the default connection TTL of 60 seconds. we are using both JMS Topics and JMS Queues.

      As most of our Clients are mobile and in a WiFi, connection losses may occur frequently, depending on the quality of the network. When the client is disconnected for 60 seconds, the broker usually closes the connection and cleans up all the sessions connected to it. The mobile Clients then create reconnect when they are online again. What we have noticed is that after many connection failures, messages may to be sent twice to the mobile clients. When analyzing the problem on the broker console, we found out that there were two consumers connected to each of the queues one mobile client usually consumes from. One of them belonged to the new connection of the mobile Client, which is fine.

      The other consumer belonged to a session whose connection already failed and was closed at that time. When analyzing the logs, we saw that for these connections, it contained a "Connection failure to ... has been detected" line, but no following "clearing up resources for session ..." log lines for these connections.

       

      Instance of the issue

       

      The broken Session is the "7a9292cb-xxx" in the picture. In the logs you can see that the connection failure was detected, but the session was never cleared by the broker (mind the timestamp).

      [WARN 2020-07-27 14:33:29,794  Thread-13  org.apache.activemq.artemis.core.client]: AMQ212037: Connection failure to /10.255.0.2:54812 has been detected: syscall:read(..) failed: Connection reset by peer [code=GENERIC_EXCEPTION]
      [WARN 2020-07-29 09:31:30,828 Thread-20   org.apache.activemq.artemis.core.client]: AMQ212037: Connection failure to /10.255.0.2:55994 has been detected: AMQ229014: Did not receive data from /10.255.0.2:55994 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
      

       

      Attached you can find the full artemis.log and our broker.xml

      Attachments

        1. duplicated consumers.png
          49 kB
          Markus Meierhofer
        2. artemis.log
          1.85 MB
          Markus Meierhofer
        3. broker.xml
          4 kB
          Markus Meierhofer
        4. three consumers per queue.png
          184 kB
          Markus Meierhofer
        5. multiple_consumers_per_queue.png
          194 kB
          Markus Meierhofer
        6. consumer_list_for_one_queue.png
          61 kB
          Markus Meierhofer
        7. session_with_connection_id.png
          19 kB
          Markus Meierhofer
        8. connection_nonexistent.png
          26 kB
          Markus Meierhofer
        9. all_connections_list.png
          52 kB
          Markus Meierhofer
        10. broker.log
          507 kB
          Markus Meierhofer

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmeierhofer Markus Meierhofer
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m