From: Xihui He Date: Mon, 30 Dec 2013 04:04:10 +0000 (+0800) Subject: msgr: fix rebind() race X-Git-Tag: v0.75~12^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f8e413f9c79a3a2a12801f5f64a2f612de3f06a0;p=ceph.git msgr: fix rebind() race stop the accepter and mark all pipes down before rebind to avoid race Fixes: #6992 Signed-off-by: Xihui He xihuihe@gmail.com --- diff --git a/src/msg/Accepter.cc b/src/msg/Accepter.cc index d6e94d1cc515c..5eebb2eec61f6 100644 --- a/src/msg/Accepter.cc +++ b/src/msg/Accepter.cc @@ -155,8 +155,6 @@ int Accepter::rebind(const set& avoid_ports) { ldout(msgr->cct,1) << "accepter.rebind avoid " << avoid_ports << dendl; - stop(); - // invalidate our previously learned address. msgr->unlearn_addr(); diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 441ed432af00b..024c965ff9590 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -277,9 +277,9 @@ int SimpleMessenger::rebind(const set& 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()