]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix deadlock in ActivePyModules::get_osdmap() 39340/head
authorpeng jiaqi <peng.jiaqi@zte.com.cn>
Tue, 5 Jan 2021 03:15:26 +0000 (11:15 +0800)
committerNathan Cutler <ncutler@suse.com>
Sun, 7 Feb 2021 12:49:27 +0000 (13:49 +0100)
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>
(cherry picked from commit 8e531ede1e8f3520aaf1202176f6282fca4ad633)

src/mgr/ActivePyModules.cc

index 33652abd0d2f9a89981f083db3b075f2afe7d874..e3f6e471229293191b8a383d6a9671a0c630692d 100644 (file)
@@ -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);
       });