summaryrefslogtreecommitdiffstats
path: root/src/msg
diff options
context:
space:
mode:
authorXie Xingguo <xie.xingguo@zte.com.cn>2019-03-03 07:43:15 +0100
committerGitHub <noreply@github.com>2019-03-03 07:43:15 +0100
commitd793c3e67b6f6b17f139e4d616acbcaba785c858 (patch)
tree85094c83e31b7d7e4b276753bd4dc58f6ebe9f2f /src/msg
parentMerge pull request #26723 from liewegas/wip-38537 (diff)
parentmsg/async/ProtocolV2: send_keepalive under the scope of lock (diff)
downloadceph-d793c3e67b6f6b17f139e4d616acbcaba785c858.tar.xz
ceph-d793c3e67b6f6b17f139e4d616acbcaba785c858.zip
Merge pull request #26668 from xiexingguo/wip-38493
msg/async/Protocol*: send keep alive if existing wins Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/msg')
-rw-r--r--src/msg/async/ProtocolV1.cc2
-rw-r--r--src/msg/async/ProtocolV2.cc10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc
index dac1bbd5840..80d2b8e26b7 100644
--- a/src/msg/async/ProtocolV1.cc
+++ b/src/msg/async/ProtocolV1.cc
@@ -1998,6 +1998,8 @@ 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 8c2d8f239fc..f45eb733be3 100644
--- a/src/msg/async/ProtocolV2.cc
+++ b/src/msg/async/ProtocolV2.cc
@@ -2464,6 +2464,8 @@ 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);
@@ -2571,6 +2573,8 @@ 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);
}
@@ -2642,12 +2646,10 @@ CtPtr ProtocolV2::handle_existing_connection(AsyncConnectionRef existing) {
ceph_assert(connection->peer_addrs->msgr2_addr() >
messenger->get_myaddrs().msgr2_addr());
- existing->lock.unlock();
// make sure we follow through with opening the existing
- // connection (if it isn't yet open) since we know the peer
- // has something to send to us.
+ // connection (if it isn't yet open) since we know the peer
+ // has something to send to us.
existing->send_keepalive();
- existing->lock.lock();
auto wait = WaitFrame::Encode(session_stream_handlers);
return WRITE(wait, "wait", read_frame);
}