From 97f30e9913b37a624eebfada06899dbdd17003e9 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Mon, 21 Jan 2019 14:52:40 +0000 Subject: [PATCH] msg/async: msgr2: fix connection fault when replacing Signed-off-by: Ricardo Dias --- src/msg/async/ProtocolV2.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 770acf6907e..392c61690bb 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -625,7 +625,7 @@ CtPtr ProtocolV2::_fault() { requeue_sent(); if (out_queue.empty() && state >= START_ACCEPT && - state <= ACCEPTING_SESSION) { + state <= ACCEPTING_SESSION && !replacing) { ldout(cct, 10) << __func__ << " with nothing to send and in the half " << " accept state just closed" << dendl; connection->write_lock.unlock(); @@ -1478,6 +1478,8 @@ CtPtr ProtocolV2::handle_ident(char *payload, uint32_t length) { CtPtr ProtocolV2::ready() { ldout(cct, 25) << __func__ << dendl; + replacing = false; + // make sure no pending tick timer if (connection->last_tick_id) { connection->center->delete_time_event(connection->last_tick_id); @@ -2947,7 +2949,6 @@ CtPtr ProtocolV2::send_server_ident() { connection->inject_delay(); connection->lock.lock(); - replacing = false; if (r < 0) { ldout(cct, 1) << __func__ << " existing race replacing process for addr = " @@ -3004,7 +3005,6 @@ CtPtr ProtocolV2::send_reconnect_ok() { connection->inject_delay(); connection->lock.lock(); - replacing = false; if (r < 0) { ldout(cct, 1) << __func__ << " existing race replacing process for addr = " -- 2.39.5