Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-6664

Connection#close may hang awaiting failover to exhaust retries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30, 0.32
    • qpid-java-6.0
    • JMS AMQP 0-x
    • None

    Description

      A client's call to Connection#close may hang awaiting failover to exhaust its retry count. This occurs because the failover thread has acquired the failover mutex, and closing sessions requires the same mutex.

      If the connection has no Sessions, instead the Connection#close will complete, but the failover thread will continue to spin in the background.

      The following could be done to fix the issue:

      1. AMQConnection#attemptReconnection while expression needs to include !isClosed().
      2. AMQConnection#close() needs to acquire the failover mutex after its call to doClose(sessions, timeout) to ensure that, in the case of a connection without sessions, the thread performing failover will have finished its work (i.e. for 0-8 the FailoverThread will be ending) before #close returns to the caller.
      3. #AMQConnection#exceptionReceived needs to lose responsibility for mutating closed/closing. This responsibility needs to be pushed to its callers. 0-10 already does this, this change will make 0-8 the same. This will mean that _closed means the user has closed the connections, or the Broker has closed the connection and failover has given up.
      4. Remove Closable#resetClosedFlag

      Attachments

        Activity

          People

            orudyy Alex Rudyy
            orudyy Alex Rudyy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: