]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: move Finisher to unlocked shutdown 10502/head
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 2 Jul 2016 01:06:17 +0000 (21:06 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Fri, 29 Jul 2016 12:15:26 +0000 (17:45 +0530)
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 <pdonnell@redhat.com>
(cherry picked from commit b1d6689b6cae579d5f1b2047fd3c653cda422454)

Conflicts:
src/mds/MDSRank.cc
trivial conflict in MDSRankDispatcher::shutdown()

src/mds/MDSRank.cc

index 68ea33eb0b343873e8365ae5162b0f2974f7d388..1b45597a3a4d3868dc8f43e9e796f2051aa0166a 100644 (file)
@@ -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.