]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: take the mon lock in handle_conf_change 29373/head
authorhuangjun <huangjun@xsky.com>
Fri, 21 Jun 2019 14:09:39 +0000 (22:09 +0800)
committerPrashant D <pdhange@redhat.com>
Sun, 28 Jul 2019 23:48:05 +0000 (19:48 -0400)
Let the finisher thread to do the job, it can hold the mon lock
and not hold the config::lock, so can avoid dead lock with mon::tick thread.

Fixes: http://tracker.ceph.com/issues/39625
Signed-off-by: huangjun <huangjun@xsky.com>
(cherry picked from commit bf57e20476cf0266840db0edd495368e43f0abb8)

src/mon/Monitor.cc

index ec6b58f39822bc298c7fc8c12f999600c25e27b8..d16bff32b3d9313e2a8b85bdef5dc93163ef0968 100644 (file)
@@ -549,11 +549,19 @@ void Monitor::handle_conf_change(const ConfigProxy& conf,
   if (changed.count("mon_health_to_clog") ||
       changed.count("mon_health_to_clog_interval") ||
       changed.count("mon_health_to_clog_tick_interval")) {
-    health_to_clog_update_conf(changed);
+    std::set<std::string> c2(changed);
+    finisher.queue(new C_MonContext(this, [this, c2](int) {
+      Mutex::Locker l(lock);
+      health_to_clog_update_conf(c2);
+    }));
   }
 
   if (changed.count("mon_scrub_interval")) {
-    scrub_update_interval(conf->mon_scrub_interval);
+    int scrub_interval = conf->mon_scrub_interval;
+    finisher.queue(new C_MonContext(this, [this, scrub_interval](int) {
+      Mutex::Locker l(lock);
+      scrub_update_interval(scrub_interval);
+    }));
   }
 }