]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: die on bind() failure 20712/head
authorJohn Spray <john.spray@redhat.com>
Mon, 26 Feb 2018 17:11:16 +0000 (17:11 +0000)
committerPrashant D <pdhange@redhat.com>
Mon, 5 Mar 2018 09:46:07 +0000 (04:46 -0500)
Previously, the daemon would get wedged if it
competed for the same port as another daemon
on the same host and lost.

Fixes: https://tracker.ceph.com/issues/23037
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 2dca5b436a21f50fd1ec404ac3197fa48a7b1b49)

src/mgr/Mgr.cc

index 94c1f31fdcf989673bdfb8ea0cfcb60c188cefe2..1d36225acbf1c9f639ba01075173600165939aa5 100644 (file)
@@ -161,8 +161,10 @@ void Mgr::init()
   // Start communicating with daemons to learn statistics etc
   int r = server.init(monc->get_global_id(), client_messenger->get_myaddr());
   if (r < 0) {
-    derr << "Initialize server fail"<< dendl;
-    return;
+    derr << "Initialize server fail: " << cpp_strerror(r) << dendl;
+    // This is typically due to a bind() failure, so let's let
+    // systemd restart us.
+    exit(1);
   }
   dout(4) << "Initialized server at " << server.get_myaddr() << dendl;