From a56b4b296fad0562db81f8a68fb22bf44884fb15 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 29 Nov 2016 12:30:30 -0800 Subject: [PATCH] Pipe::stop_and_wait: unlock pipe_lock for stop_fast_dispatching() OSD::ms_fast_dispatch may need the pipe_lock to finish what it's doing and avoid a deadlock. Fixes: http://tracker.ceph.com/issues/18042 Signed-off-by: Samuel Just --- src/msg/simple/Pipe.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index c57790d0566..5edec546bee 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -1561,6 +1561,7 @@ void Pipe::stop() void Pipe::stop_and_wait() { + assert(pipe_lock.is_locked_by_me()); if (state != STATE_CLOSED) stop(); @@ -1574,7 +1575,9 @@ void Pipe::stop_and_wait() } if (delay_thread) { + pipe_lock.Unlock(); delay_thread->stop_fast_dispatching(); + pipe_lock.Lock(); } while (reader_running && reader_dispatching) -- 2.47.3