From df6684b0ca24d51e2cee577d4922fedaf54f3989 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Sun, 27 Aug 2017 13:37:18 -0700 Subject: [PATCH] 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 --- src/msg/async/AsyncConnection.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.47.3