From 82e8fb20cad3462daae286098235750aecdc76c4 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Fri, 18 Oct 2019 12:31:14 +0200 Subject: [PATCH] Revert "msg/async: do not trigger RESETSESSION from connect fault during connection phase" This reverts commit 00b163564c6cafd4edf54d470cc708eab9dae10e. Xie Xingguo and Ricardo Dias looked at this, and both agreed that the bug was caused with the reduction of states of the V1 protocol during its refactoring. In other words, the bug is not present in mimic. Signed-off-by: Nathan Cutler --- src/msg/async/AsyncConnection.cc | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index d196c00c6dd..3621b125b61 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -2118,9 +2118,20 @@ void AsyncConnection::fault() } write_lock.unlock(); - if ((state >= STATE_CONNECTING && state <= STATE_CONNECTING_SEND_CONNECT_MSG) || - state == STATE_WAIT) { - // backoff! + if (!(state >= STATE_CONNECTING && state < STATE_CONNECTING_READY) && + state != STATE_WAIT) { // STATE_WAIT is coming from STATE_CONNECTING_* + // policy maybe empty when state is in accept + if (policy.server) { + ldout(async_msgr->cct, 0) << __func__ << " server, going to standby" << dendl; + state = STATE_STANDBY; + } else { + ldout(async_msgr->cct, 0) << __func__ << " initiating reconnect" << dendl; + connect_seq++; + state = STATE_CONNECTING; + } + backoff = utime_t(); + center->dispatch_event_external(read_handler); + } else { if (state == STATE_WAIT) { backoff.set_from_double(async_msgr->cct->_conf->ms_max_backoff); } else if (backoff == utime_t()) { @@ -2136,18 +2147,6 @@ void AsyncConnection::fault() // woke up again; register_time_events.insert(center->create_time_event( backoff.to_nsec()/1000, wakeup_handler)); - } else { - // policy maybe empty when state is in accept - if (policy.server) { - ldout(async_msgr->cct, 0) << __func__ << " server, going to standby" << dendl; - state = STATE_STANDBY; - } else { - ldout(async_msgr->cct, 0) << __func__ << " initiating reconnect" << dendl; - connect_seq++; - state = STATE_CONNECTING; - } - backoff = utime_t(); - center->dispatch_event_external(read_handler); } } -- 2.47.3