Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 <huangjun@xsky.com>
  • Loading branch information
huangjun committed Jun 21, 2019
1 parent 5b94f8b commit bf57e20
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/mon/Monitor.cc
Expand Up @@ -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<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);
}));
}
}

Expand Down

0 comments on commit bf57e20

Please sign in to comment.