From: Patrick Donnelly Date: Sat, 2 Jul 2016 01:06:17 +0000 (-0400) Subject: mds: move Finisher to unlocked shutdown X-Git-Tag: v10.2.3~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c2eab19e2c088e97de924f7f1a633a9f291439d;p=ceph.git mds: move Finisher to unlocked shutdown This commit resolves a deadlock reported in i16042 where the thread calling MDSRankDispatcher::shutdown would hold the mds_lock while asynchronous callbacks in the Finisher would attempt to lock mds_lock. For simplicity, I merged the finisher stop with the messenger shutdown as both need the mds_lock dropped. Fixes: http://tracker.ceph.com/issues/16042 Signed-off-by: Patrick Donnelly (cherry picked from commit b1d6689b6cae579d5f1b2047fd3c653cda422454) Conflicts: src/mds/MDSRank.cc trivial conflict in MDSRankDispatcher::shutdown() --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 68ea33eb0b34..1b45597a3a4d 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -222,8 +222,6 @@ void MDSRankDispatcher::shutdown() // threads block on IOs that require finisher to complete. mdlog->shutdown(); - finisher->stop(); // no flushing - // shut down cache mdcache->shutdown(); @@ -236,9 +234,17 @@ void MDSRankDispatcher::shutdown() progress_thread.shutdown(); + // release mds_lock for finisher/messenger threads (e.g. + // MDSDaemon::ms_handle_reset called from Messenger). + mds_lock.Unlock(); + + finisher->stop(); // no flushing + // shut down messenger messenger->shutdown(); + mds_lock.Lock(); + // Workaround unclean shutdown: HeartbeatMap will assert if // worker is not removed (as we do in ~MDS), but ~MDS is not // always called after suicide.