From fd520a17db863057f401d206777a95d3458f498e Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 5 Mar 2019 19:46:09 +0800 Subject: [PATCH] Revert "msg/async/Protocol*: send keep alive if existing wins" This reverts commit 61b9432ef9a3847eceb96f8d5a854567c49bbf61. If we are in the middle of replacing, we can not queue any further write events into the old center because we may end up replacing existing connection's center with a new one, and hence executing the newly queued write events in the old thread. See **transfer_existing** for a detailed description. Also the patch does not make a lot of sense for the original issue it tried to resolve, because **send_keepalive** is a pure noop if the underlying connection is not ready, which is obviously true for the case demonstrated in http://tracker.ceph.com/issues/38493.. Fixes: http://tracker.ceph.com/issues/38569 Signed-off-by: xie xingguo --- src/msg/async/ProtocolV1.cc | 2 -- src/msg/async/ProtocolV2.cc | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index a5cd40125d86b..7fbd5c67c5896 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -2007,8 +2007,6 @@ CtPtr ProtocolV1::handle_connect_message_2() { << " existing_state=" << connection->get_state_name(existing->state) << dendl; reply.global_seq = exproto->peer_global_seq; - // make sure we notice if existing connection is no longer functioning - existing->send_keepalive(); existing->lock.unlock(); return send_connect_message_reply(CEPH_MSGR_TAG_RETRY_GLOBAL, reply, authorizer_reply); diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index b1215b7164fda..7481ab14c5d71 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -2316,8 +2316,6 @@ CtPtr ProtocolV2::handle_reconnect(ceph::bufferlist &payload) ldout(cct, 1) << __func__ << " existing racing replace happened while replacing." << " existing=" << existing << dendl; - // make sure we notice if existing connection is no longer functioning - existing->send_keepalive(); auto retry = RetryGlobalFrame::Encode(session_stream_handlers, exproto->peer_global_seq); return WRITE(retry, "session retry", read_frame); @@ -2425,8 +2423,6 @@ CtPtr ProtocolV2::handle_existing_connection(AsyncConnectionRef existing) { ldout(cct, 1) << __func__ << " existing racing replace happened while replacing." << " existing=" << existing << dendl; - // make sure we notice if existing connection is no longer functioning - existing->send_keepalive(); auto wait = WaitFrame::Encode(session_stream_handlers); return WRITE(wait, "wait", read_frame); } -- 2.39.5