]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
SimpleMessenger: allow multiple calls to shutdown
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 27 May 2011 21:04:36 +0000 (14:04 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 27 May 2011 21:05:27 +0000 (14:05 -0700)
Fixes a case where radostool crashed on an error shutdown.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/msg/SimpleMessenger.cc

index a96363ee8ab5c7145e136a3377084e8d40677e55..a27ae6144e7c71056004466088d70dcb98240266 100644 (file)
@@ -2586,6 +2586,10 @@ int SimpleMessenger::send_keepalive(const entity_inst_t& dest)
 void SimpleMessenger::wait()
 {
   lock.Lock();
+  if (!started) {
+    lock.Unlock();
+    return;
+  }
   while (!destination_stopped) {
     dout(10) << "wait: still active" << dendl;
     wait_cond.Wait(lock);
@@ -2608,6 +2612,7 @@ void SimpleMessenger::wait()
     reaper_stop = true;
     lock.Unlock();
     reaper_thread.join();
+    reaper_started = false;
     dout(20) << "wait: stopped reaper thread" << dendl;
   }