From: peng jiaqi Date: Tue, 5 Jan 2021 03:15:26 +0000 (+0800) Subject: mgr: fix deadlock in ActivePyModules::get_osdmap() X-Git-Tag: v14.2.17~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db08b1b4b6780e31f03fa4ec16f7b388f6e39fed;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 33652abd0d2..e3f6e471229 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -912,7 +912,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); });