From 18dda820c0f3f0d59965ee549dc77eaac110008d Mon Sep 17 00:00:00 2001 From: peng jiaqi Date: Tue, 5 Jan 2021 11:15:26 +0800 Subject: [PATCH] mgr: fix deadlock in ActivePyModules::get_osdmap() In function "ActivePyModules::get_osdmap()", We do not read or write to object "ActivePyModules", so it is safe to delete lock "ActivePyModules::lock", and it can avoid other thread waiting for lock "ActivePyModules::lock" Fixes: https://tracker.ceph.com/issues/48852 Signed-off-by: peng jiaqi (cherry picked from commit 8e531ede1e8f3520aaf1202176f6282fca4ad633) --- src/mgr/ActivePyModules.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 1d00c9b7e57..efafa726522 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -932,7 +932,6 @@ PyObject *ActivePyModules::get_osdmap() PyThreadState *tstate = PyEval_SaveThread(); { - std::lock_guard l(lock); cluster_state.with_osdmap([&](const OSDMap& o) { newmap->deepish_copy_from(o); }); -- 2.47.3