]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: mgr::init() return when connection daemons failed
authorhuanwen ren <ren.huanwen@zte.com.cn>
Tue, 11 Oct 2016 11:29:52 +0000 (19:29 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Tue, 11 Oct 2016 11:29:52 +0000 (19:29 +0800)
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mgr/DaemonServer.cc
src/mgr/Mgr.cc

index f0be92a1a9df4c176102c05c1cdabd6634c35a23..b879b00f88a83bb4b2bf52af5887c02fcafc932b 100644 (file)
@@ -48,8 +48,10 @@ int DaemonServer::init(uint64_t gid, entity_addr_t client_addr)
   msgr = Messenger::create(g_ceph_context, g_conf->ms_type,
       entity_name_t::MGR(gid), "server", getpid());
   int r = msgr->bind(g_conf->public_addr);
-  if (r < 0)
+  if (r < 0) {
+    derr << "unable to bind mgr to " << g_conf->public_addr << dendl;
     return r;
+  }
 
   msgr->set_myname(entity_name_t::MGR(gid));
   msgr->set_addr_unknowns(client_addr);
index 834eb9111f663c4beb160112bd388339b6eb5671..d22cc43b39cdf29132357644fc058d0655339447 100644 (file)
@@ -148,7 +148,11 @@ void Mgr::init()
   assert(!initialized);
 
   // Start communicating with daemons to learn statistics etc
-  server.init(monc->get_global_id(), client_messenger->get_myaddr());
+  int r = server.init(monc->get_global_id(), client_messenger->get_myaddr());
+  if (r < 0) {
+    derr << "Initialize server fail"<< dendl;
+    return;
+  }
   dout(4) << "Initialized server at " << server.get_myaddr() << dendl;
 
   // Preload all daemon metadata (will subsequently keep this