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()
// threads block on IOs that require finisher to complete.
mdlog->shutdown();
- finisher->stop(); // no flushing
-
// shut down cache
mdcache->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.