From: Ricardo Dias Date: Mon, 21 Jan 2019 14:52:40 +0000 (+0000) Subject: msg/async: msgr2: fix connection fault when replacing X-Git-Tag: v14.1.0~271^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=97f30e9913b37a624eebfada06899dbdd17003e9;p=ceph.git msg/async: msgr2: fix connection fault when replacing Signed-off-by: Ricardo Dias --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 770acf6907e5..392c61690bb5 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 = "