summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-15 17:10:23 -0700
committerSage Weil <sage@inktank.com>2013-07-17 14:36:37 -0700
commit07a0860a1899c7353bb506e33de72fdd22b857dd (patch)
treeb78649b78bb83ac6587e6c948158d5334151f4b3
parentad548e72fd94b4a16717abd3b3f1d1be4a3476cf (diff)
downloadceph-07a0860a1899c7353bb506e33de72fdd22b857dd.tar.gz
msgr: mark_down_all() after, not before, rebind
If we are shutting down all old connections and binding to new ports, we want to avoid a sequence like: - close all prevoius connections - new connection comes in on old port - rebind to new ports -> connection from old port leaks through As a first step, close all connections after we shut down the old accepter and before we start the new one. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/msg/SimpleMessenger.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc
index 48e37d87098..2afa449dfbc 100644
--- a/src/msg/SimpleMessenger.cc
+++ b/src/msg/SimpleMessenger.cc
@@ -276,9 +276,10 @@ int SimpleMessenger::bind(const entity_addr_t &bind_addr)
int SimpleMessenger::rebind(const set<int>& avoid_ports)
{
ldout(cct,1) << "rebind avoid " << avoid_ports << dendl;
- mark_down_all();
assert(did_bind);
- return accepter.rebind(avoid_ports);
+ int r = accepter.rebind(avoid_ports);
+ mark_down_all();
+ return r;
}
int SimpleMessenger::start()