From: huangjun Date: Fri, 21 Jun 2019 14:09:39 +0000 (+0800) Subject: mon: take the mon lock in handle_conf_change X-Git-Tag: v15.1.0~2373^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf57e20476cf0266840db0edd495368e43f0abb8;p=ceph.git mon: take the mon lock in handle_conf_change 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 3c06dc2610b9..c2d62ed94aa4 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -550,11 +550,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 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); + })); } }