Qpid
  1. Qpid
  2. QPID-3355

Client aborts when replaying sender after connection recovery

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7, 0.10
    • Fix Version/s: 0.13
    • Component/s: C++ Client
    • Labels:
      None

      Description

      There is a race condition between qpid::client::SessionImpl::waitForCompletion and qpid::client::SessionImpl::~SessionImpl. If one thread is waiting for a
      completion and another thread causes the destructor for the session to be invoked, the destructor can abort the client if waitForCompletion is still holding the state mutex. The reason this occurs is because waitForCompletion is not holding a Waiter::ScopedWait, so the destructor completes while the
      mutex is still being held. This was discovered when testing connection loss and recovery.

      1. QPID-3355.patch
        0.4 kB
        Jason Dillaman

        Activity

        Hide
        Jason Dillaman added a comment -

        Patch to hold qpid::sys::Waitable::ScopedWait within waitForCompletion

        Show
        Jason Dillaman added a comment - Patch to hold qpid::sys::Waitable::ScopedWait within waitForCompletion
        Hide
        Gordon Sim added a comment -

        I have committed this patch since it is logically consistent and may indeed prevent this specific issue. However the root cause is I believe in the messaging implementation above this, where the session is reset while a sync() call is in progress. If the session is referenced while calling sync() then the issue the attached patch fixes won't even occur. Its possible there are other forms of failure possible from the root cause as well so I have fixed that too.

        Show
        Gordon Sim added a comment - I have committed this patch since it is logically consistent and may indeed prevent this specific issue. However the root cause is I believe in the messaging implementation above this, where the session is reset while a sync() call is in progress. If the session is referenced while calling sync() then the issue the attached patch fixes won't even occur. Its possible there are other forms of failure possible from the root cause as well so I have fixed that too.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jason Dillaman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development