Qpid
  1. Qpid
  2. QPID-4672

C++ Broker deadlock detaching XmlExchange sessions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.20
    • Fix Version/s: 0.22
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      C++ Broker, autotools build, make check or run_federation_tests

      Description

      Self test federation.FederationTests.test_dynamic_topic locks up. Pstack shows three threads with the same trace:

      #0 pthread_rwlock_wrlock ()
      #1 qpid::broker::XmlExchange::unbind()
      #2 qpid::broker::XmlExchange::fedUnbind()
      #3 qpid::broker::XmlExchange::bind()
      #4 qpid::broker::Queue::bind()
      #5 qpid::broker::Broker::bind()
      #6 qpid::broker::SemanticState::unbindSessionBindings()
      #7 qpid::broker::SemanticState::closed()
      #8 qpid::broker::SessionState::~SessionState()
      #9 qpid::broker::SessionState::~SessionState()
      #10 qpid::broker::SessionHandler::handleDetach()
      #11 qpid::amqp_0_10::SessionHandler::detach()

      The lock occurs because there are two simultaneous session detach calls going on. Each takes out the Rlock and then tries to take out the Wlock. Neither will get the Wlock until everyone else releases their Rlock. Subsequent detach calls fall into the same catch as they get the Rlock but not the Wlock.

      This condition is present in both the XmlExchange and DirectExchange. I'll have a patch for review shortly.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        33d 7h 15m 1 Chuck Rolke 29/Apr/13 20:29
        Resolved Resolved Closed Closed
        90d 22h 24m 1 Justin Ross 29/Jul/13 18:54
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Chuck Rolke made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.22 [ 12324272 ]
        Resolution Fixed [ 1 ]
        Hide
        Chuck Rolke added a comment -

        Fixed and back ported to 0.22

        Show
        Chuck Rolke added a comment - Fixed and back ported to 0.22
        Hide
        Justin Ross added a comment -

        Reviewed by Gordon. Approved for 0.22.

        Show
        Justin Ross added a comment - Reviewed by Gordon. Approved for 0.22.
        Hide
        Gordon Sim added a comment -

        I concur with backporting to 0.22

        Show
        Gordon Sim added a comment - I concur with backporting to 0.22
        Hide
        Chuck Rolke added a comment -

        Fixed in r1461634.
        https://reviews.apache.org/r/10155/
        Will request back port into 0.22

        Show
        Chuck Rolke added a comment - Fixed in r1461634. https://reviews.apache.org/r/10155/ Will request back port into 0.22
        Chuck Rolke created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Chuck Rolke
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development