]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
SimpleMessenger: Pipe: do not block on takeover while holding global lock
authorGreg Farnum <gfarnum@redhat.com>
Tue, 28 Oct 2014 23:45:43 +0000 (16:45 -0700)
committerSage Weil <sage@redhat.com>
Thu, 13 Nov 2014 17:14:40 +0000 (09:14 -0800)
commit2d6980570af2226fdee0edfcfe5a8e7f60fae615
treeb2e5f902394600016e96cd77123e82a63d3d3a23
parentd76bfc2e8ebed3a187d4b6c6019f6782255cabe7
SimpleMessenger: Pipe: do not block on takeover while holding global lock

We previously were able to cause deadlocks:
1) Existing pipe is fast_dispatching
2) Replacement incoming pipe is accepted
  *) blocks on stop_and_wait() of existing Pipe
3) External things are blocked on SimpleMessenger::lock() while
  blocking completion of the fast dispatch.

To resolve this, if we detect that an existing Pipe we want to take over is
in the process of fast dispatching, we unlock our locks and wait on it to
finish. Then we go back to the lookup step and retry.

The effect of this should be safe:
1) We are not making any changes to the existing Pipe in new ways
2) We have not registered the new Pipe anywhere
3) We have not sent back any replies based on Messenger state to
   the remote endpoint.

Backport: giant

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/msg/simple/Pipe.cc
src/msg/simple/Pipe.h