]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: fix rebind() race 1016/head
authorXihui He <xihuihe@gmail.com>
Mon, 30 Dec 2013 04:04:10 +0000 (12:04 +0800)
committerXihui He <xihuihe@gmail.com>
Tue, 31 Dec 2013 02:57:57 +0000 (10:57 +0800)
stop the accepter and mark all pipes down before rebind to avoid race

Fixes: #6992
Signed-off-by: Xihui He xihuihe@gmail.com
src/msg/Accepter.cc
src/msg/SimpleMessenger.cc

index d6e94d1cc515c4adff90a0d608148017e691c965..5eebb2eec61f69d25ad5b3313204c00933d9aebf 100644 (file)
@@ -155,8 +155,6 @@ int Accepter::rebind(const set<int>& avoid_ports)
 {
   ldout(msgr->cct,1) << "accepter.rebind avoid " << avoid_ports << dendl;
   
-  stop();
-
   // invalidate our previously learned address.
   msgr->unlearn_addr();
 
index 441ed432af00bf57c085482cde46a8290262c110..024c965ff9590316d758828e0014c13191cb6518 100644 (file)
@@ -277,9 +277,9 @@ int SimpleMessenger::rebind(const set<int>& avoid_ports)
 {
   ldout(cct,1) << "rebind avoid " << avoid_ports << dendl;
   assert(did_bind);
-  int r = accepter.rebind(avoid_ports);
+  accepter.stop();
   mark_down_all();
-  return r;
+  return accepter.rebind(avoid_ports);
 }
 
 int SimpleMessenger::start()