From d7ba56f4214148a2378adcf47da9916a752bc7a0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Jul 2017 13:48:00 -0400 Subject: [PATCH] mgr/DaemonServer: fix lock cycle This breaks a lock cycle with DaemonState::lock and PyModules::lock. Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 16729abc246..dffa6b7c3b9 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -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; -- 2.39.5