]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: fix lock cycle
authorSage Weil <sage@redhat.com>
Sat, 22 Jul 2017 17:48:00 +0000 (13:48 -0400)
committerSage Weil <sage@redhat.com>
Sat, 22 Jul 2017 17:48:00 +0000 (13:48 -0400)
This breaks a lock cycle with DaemonState::lock and PyModules::lock.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc

index 16729abc246c6b5c767aa7e5c45aff6a15b53edd..dffa6b7c3b918f9955feca586efe740252320bf0 100644 (file)
@@ -398,9 +398,11 @@ bool DaemonServer::handle_report(MMgrReport *m)
     // always contains metadata.
   }
   assert(daemon != nullptr);
-  Mutex::Locker l(daemon->lock);
   auto &daemon_counters = daemon->perf_counters;
-  daemon_counters.update(m);
+  {
+    Mutex::Locker l(daemon->lock);
+    daemon_counters.update(m);
+  }
   // if there are any schema updates, notify the python modules
   if (!m->declare_types.empty() || !m->undeclare_types.empty()) {
     ostringstream oss;