]> git.apps.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, 24 Jul 2013 23:20:36 +0000 (16:20 -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>
(cherry picked from commit 07a0860a1899c7353bb506e33de72fdd22b857dd)

Conflicts:

src/msg/SimpleMessenger.cc

src/msg/SimpleMessenger.cc

index c60be44e22dff87c65a8a118d82ea372b2f59c95..71bdb8b341d3fb9e2c6511d599aa57b3038d95c2 100644 (file)
@@ -271,9 +271,10 @@ int SimpleMessenger::bind(const entity_addr_t &bind_addr)
 int SimpleMessenger::rebind(int avoid_port)
 {
   ldout(cct,1) << "rebind avoid " << avoid_port << dendl;
-  mark_down_all();
   assert(did_bind);
-  return accepter.rebind(avoid_port);
+  int r = accepter.rebind(avoid_port);
+  mark_down_all();
+  return r;
 }
 
 int SimpleMessenger::start()