From f938a5bf604885ffba65a9b86e19258ca254e58c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 15 Jul 2013 17:10:23 -0700 Subject: [PATCH] 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 (cherry picked from commit 07a0860a1899c7353bb506e33de72fdd22b857dd) Conflicts: src/msg/SimpleMessenger.cc --- src/msg/SimpleMessenger.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index c60be44e22dff..71bdb8b341d3f 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -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() -- 2.39.5