From: Sage Weil Date: Tue, 16 Jul 2013 00:10:23 +0000 (-0700) Subject: msgr: mark_down_all() after, not before, rebind X-Git-Tag: v0.67-rc1~42^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=07a0860a1899c7353bb506e33de72fdd22b857dd;p=ceph.git 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 --- diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 48e37d870984..2afa449dfbce 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& 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()