From: Nathan Cutler Date: Fri, 18 Oct 2019 10:31:14 +0000 (+0200) Subject: Revert "msg/async: do not trigger RESETSESSION from connect fault during connection... X-Git-Tag: v13.2.7~51^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30991%2Fhead;p=ceph.git 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 --- 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); } }