]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: mark_down_all() after, not before, rebind
authorSage Weil <sage@inktank.com>
Tue, 16 Jul 2013 00:10:23 +0000 (17:10 -0700)
committerSage Weil <sage@inktank.com>
Wed, 17 Jul 2013 21:36:37 +0000 (14:36 -0700)
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>
src/msg/SimpleMessenger.cc

index 48e37d87098404547638e43475ec38744653bb3e..2afa449dfbce9dd85a8d330d68cda831c3035134 100644 (file)
@@ -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()