]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: take the mon lock in handle_conf_change 29741/head
authorhuangjun <huangjun@xsky.com>
Fri, 21 Jun 2019 14:09:39 +0000 (22:09 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 19 Aug 2019 14:51:40 +0000 (16:51 +0200)
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 ebecd6884af5154a8ec06697ff13c159af8cfb46..19d1735cdf0ae8d4ed68b972d453634f9b6e2902 100644 (file)
@@ -516,11 +516,19 @@ void Monitor::handle_conf_change(const struct md_config_t *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);
+    }));
   }
 }