]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/Mgr: drop lock while fetching config-keys
authorSage Weil <sage@redhat.com>
Tue, 4 Apr 2017 19:59:05 +0000 (15:59 -0400)
committerSage Weil <sage@redhat.com>
Tue, 4 Apr 2017 19:59:05 +0000 (15:59 -0400)
This avoids a deadlock if some other message arrives before
the command reply and needs to take the mgr lock in dispatch.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/Mgr.cc

index 5fa65f7b75759156addd695cf3ec4b7d5c981bb6..a3a00807031f552ce16d75907d77d3b9f2a29d2a 100644 (file)
@@ -193,6 +193,7 @@ void Mgr::init()
   }
 
   dout(4) << "waiting for config-keys..." << dendl;
+
   // Preload config keys (`get` for plugins is to be a fast local
   // operation, we we don't have to synchronize these later because
   // all sets will come via mgr)
@@ -305,8 +306,9 @@ void Mgr::load_config()
   dout(10) << "listing keys" << dendl;
   JSONCommand cmd;
   cmd.run(monc, "{\"prefix\": \"config-key list\"}");
-
+  lock.Unlock();
   cmd.wait();
+  lock.Lock();
   assert(cmd.r == 0);
 
   std::map<std::string, std::string> loaded;