From: peng jiaqi Date: Tue, 5 Jan 2021 03:15:26 +0000 (+0800) Subject: mgr: fix deadlock in ActivePyModules::get_osdmap() X-Git-Tag: v15.2.13~2^2~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18dda820c0f3f0d59965ee549dc77eaac110008d;p=ceph.git 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) --- diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 1d00c9b7e572..efafa726522b 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); });