]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/SimpleMessenger: start accepter in ready()
authorSage Weil <sage@inktank.com>
Tue, 30 Oct 2012 20:19:30 +0000 (13:19 -0700)
committerSage Weil <sage@inktank.com>
Tue, 30 Oct 2012 20:21:48 +0000 (13:21 -0700)
Start the accepter thread when the first dispatcher is ready.  This ensures
that there will be someone around to verify authorizers for incoming
connections, and means we have a bit less failure noise on the monitors
as a result.

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/SimpleMessenger.cc

index 6db721113fff1e7994ff796337de838a7625c0d7..6ae3af7c9ee843f69ada506c10591c777f4dafa8 100644 (file)
@@ -73,6 +73,11 @@ void SimpleMessenger::ready()
 {
   ldout(cct,10) << "ready " << get_myaddr() << dendl;
   dispatch_queue.start();
+
+  lock.Lock();
+  if (did_bind)
+    accepter.start();
+  lock.Unlock();
 }
 
 
@@ -287,9 +292,6 @@ int SimpleMessenger::start()
 
   lock.Unlock();
 
-  if (did_bind)
-    accepter.start();
-
   reaper_started = true;
   reaper_thread.create();
   return 0;