]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: don't stuck into resetsession/retrysession loop 17276/head
authorHaomai Wang <haomai@xsky.com>
Sun, 27 Aug 2017 05:09:54 +0000 (22:09 -0700)
committerHaomai Wang <haomai@xsky.com>
Sun, 27 Aug 2017 05:09:54 +0000 (22:09 -0700)
if exist connection's connect_seq is zero and state is STANDBY and peer
connection is new, we will reply with RETRYSESSION and make peer connection
incr connect_seq. Then we receive connect.connect_seq==1, but
existing->connect_seq is still zero, so RESETSESSION tag replied.

RESET->RETRY->RESET loop is forever

Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/AsyncConnection.cc

index e7895ddca75ac321b90548a0edaf7990d04f0ecd..6941bcc8ed4e6ee90de0f696089df72c43126f6c 100644 (file)
@@ -1609,6 +1609,11 @@ ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlis
         ldout(async_msgr->cct, 10) << __func__ << " accept connection race, existing " << existing
                              << ".cseq " << existing->connect_seq << " == "
                              << connect.connect_seq << ", OPEN|STANDBY, RETRY_SESSION" << dendl;
+        // if connect_seq both zero, dont stuck into dead lock. it's ok to replace
+        if (policy.resetcheck && existing->connect_seq == 0) {
+          goto replace;
+        }
+
         reply.connect_seq = existing->connect_seq + 1;
         existing->lock.unlock();
         return _reply_accept(CEPH_MSGR_TAG_RETRY_SESSION, connect, reply, authorizer_reply);