From: Sage Weil Date: Mon, 1 May 2017 14:33:36 +0000 (-0400) Subject: osd: stop MgrClient callbacks on shutdown X-Git-Tag: v12.0.3~144^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14896%2Fhead;p=ceph.git osd: stop MgrClient callbacks on shutdown Stop the MgrClient callbacks to report PG stats at the start of shutdown() so that we don't get a callback during/after we are done shutting down. Protect the cb update with the MgrClient's lock so that we don't race with MgrClient::send_report() itself. Fixes: http://tracker.ceph.com/issues/19638 Signed-off-by: Sage Weil --- diff --git a/src/mgr/MgrClient.h b/src/mgr/MgrClient.h index adc35fe406f7..f9385b8be6df 100644 --- a/src/mgr/MgrClient.h +++ b/src/mgr/MgrClient.h @@ -95,6 +95,7 @@ public: void set_pgstats_cb(std::function cb_) { + Mutex::Locker l(lock); pgstats_cb = cb_; } diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f521faa69a23..d1bb2d96445e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2947,6 +2947,8 @@ int OSD::shutdown() cct->_conf->set_val("debug_ms", "100"); cct->_conf->apply_changes(NULL); + mgrc.set_pgstats_cb(std::function()); + service.start_shutdown(); // stop sending work to pgs. this just prevents any new work in _process