]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix deadlock in ActivePyModules::get_osdmap() 38762/head
authorpeng jiaqi <peng.jiaqi@zte.com.cn>
Tue, 5 Jan 2021 03:15:26 +0000 (11:15 +0800)
committerpeng jiaqi <peng.jiaqi@zte.com.cn>
Fri, 15 Jan 2021 08:14:22 +0000 (16:14 +0800)
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 <peng.jiaqi@zte.com.cn>
src/mgr/ActivePyModules.cc

index 0b9fd9d158c222d9e4ea041473a50b1ce710a3bb..41fdd01a0ea5b5df2fa44f701bd1dab98bc5c2bb 100644 (file)
@@ -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);
       });