From d7ba56f4214148a2378adcf47da9916a752bc7a0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Jul 2017 13:48:00 -0400 Subject: [PATCH 1/2] 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; From bb2c84eda64118f5ef2651026aa7f67f13ad194c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Jul 2017 13:48:17 -0400 Subject: [PATCH 2/2] mgr/PyModules: fix lock name Signed-off-by: Sage Weil --- src/mgr/PyModules.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mgr/PyModules.h b/src/mgr/PyModules.h index 062feb53162..1c6751f4e51 100644 --- a/src/mgr/PyModules.h +++ b/src/mgr/PyModules.h @@ -43,7 +43,7 @@ class PyModules Client &client; Finisher &finisher; - mutable Mutex lock{"PyModules"}; + mutable Mutex lock{"PyModules::lock"}; std::string get_site_packages();