From: Haomai Wang Date: Sun, 27 Aug 2017 20:37:18 +0000 (-0700) Subject: msg/async: don't kill connection if replacing X-Git-Tag: v13.0.1~1143^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17288%2Fhead;p=ceph.git msg/async: don't kill connection if replacing when existing connection is replacing, then meet send error, we can't kill this existing connection. otherwise, when peer side reconnect, we will detect reset condition and send resetsession to make peer discard messages. Fixes: http://tracker.ceph.com/issues/21143 Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index e7895ddca75a..0370ab9618f8 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -2061,11 +2061,11 @@ void AsyncConnection::fault() requeue_sent(); recv_start = recv_end = 0; state_offset = 0; - replacing = false; is_reset_from_peer = false; outcoming_bl.clear(); if (!once_ready && !is_queued() && - state >=STATE_ACCEPTING && state <= STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH) { + state >=STATE_ACCEPTING && state <= STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH && + !replacing) { ldout(async_msgr->cct, 10) << __func__ << " with nothing to send and in the half " << " accept state just closed" << dendl; write_lock.unlock(); @@ -2073,6 +2073,7 @@ void AsyncConnection::fault() dispatch_queue->queue_reset(this); return ; } + replacing = false; reset_recv_state(); if (policy.standby && !is_queued() && state != STATE_WAIT) { ldout(async_msgr->cct, 10) << __func__ << " with nothing to send, going to standby" << dendl;