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

Race condition w/TTL impacting in-vm connections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.32.0
    • None
    • None

    Description

      The following WARN can occur due to a race condition between the initialization of org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry and the periodic check by RemotingServiceImpl$FailureCheckAndFlushThread:

      AMQ212037: Connection failure to invm:0 has been detected: AMQ229014: Did not receive data from invm:0 within the -1ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT]

      Also, the following ERROR message can happen at the same time:

      ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219010: Connection is destroyed]

      Internally, the org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry is subject to the following race condition:

      1. ConnectionEntry is initilalized with the default ActiveMQClient.DEFAULT_CONNECTION_TTL (60000) at CoreProtocolManager#createConnectionEntry()
      2. RemotingServiceImpl$FailureCheckAndFlushThread evaluates if (entry.ttl != -1) as true.
      3. A Ping is sent. Then ttl is updated to ActiveMQClient.DEFAULT_CONNECTION_TTL_INVM (-1).
      4. RemotingServiceImpl$FailureCheckAndFlushThread checks if (now >= entry.lastCheck + entry.ttl). Since ttl has been updated to -1 the check passes (= expired) and the connection will be added to toRemove.
      5. The WARN and ERROR occur.

      Attachments

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              jbertram Justin Bertram
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20m
                  20m