From: peng jiaqi Date: Tue, 5 Jan 2021 03:15:26 +0000 (+0800) Subject: mgr: fix deadlock in ActivePyModules::get_osdmap() X-Git-Tag: v16.1.0~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38762%2Fhead;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 --- diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 0b9fd9d158c2..41fdd01a0ea5 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -930,7 +930,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); });