]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix beacon interruption caused by deadlock 23482/head
authorYan Jun <yan.jun8@zte.com.cn>
Wed, 8 Aug 2018 07:24:37 +0000 (15:24 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Wed, 8 Aug 2018 07:24:37 +0000 (15:24 +0800)
There is potential deadlock between this code and DaemonServer::send_report()

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/mgr/ActivePyModules.cc

index 6da3576bbb3a35282eb4ee3d5645c3b2449c750f..ee0d791ff5da3dd3ded2855ee2b1f15da9c2908d 100644 (file)
@@ -314,9 +314,9 @@ PyObject *ActivePyModules::get_python(const std::string &what)
   } else if (what == "df") {
     PyFormatter f;
 
-    cluster_state.with_osdmap([this, &f](const OSDMap &osd_map){
-      cluster_state.with_pgmap(
-          [&osd_map, &f](const PGMap &pg_map) {
+    cluster_state.with_pgmap([this, &f](const PGMap &pg_map) {
+      cluster_state.with_osdmap(
+          [&pg_map, &f](const OSDMap &osd_map) {
         pg_map.dump_fs_stats(nullptr, &f, true);
         pg_map.dump_pool_stats_full(osd_map, nullptr, &f, true);
       });