]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: stop MgrClient callbacks on shutdown 14896/head
authorSage Weil <sage@redhat.com>
Mon, 1 May 2017 14:33:36 +0000 (10:33 -0400)
committerSage Weil <sage@redhat.com>
Mon, 1 May 2017 14:33:36 +0000 (10:33 -0400)
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 <sage@redhat.com>
src/mgr/MgrClient.h
src/osd/OSD.cc

index adc35fe406f757379ca70ecadb77aae725ee39c3..f9385b8be6df53dad221dd043580ebe555d3c9fc 100644 (file)
@@ -95,6 +95,7 @@ public:
 
   void set_pgstats_cb(std::function<MPGStats*()> cb_)
   {
+    Mutex::Locker l(lock);
     pgstats_cb = cb_;
   }
 
index f521faa69a23c37da01cfaed84922f8345e70083..d1bb2d96445eb9fd879e8928c57166efd3b182c1 100644 (file)
@@ -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<MPGStats*()>());
+
   service.start_shutdown();
 
   // stop sending work to pgs.  this just prevents any new work in _process