From 83c45ad6a440046d8e4a41a60edd3ad5146e6bd1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 1 May 2017 10:33:36 -0400 Subject: [PATCH] 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 --- src/mgr/MgrClient.h | 1 + src/osd/OSD.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mgr/MgrClient.h b/src/mgr/MgrClient.h index adc35fe406f..f9385b8be6d 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 f521faa69a2..d1bb2d96445 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