]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: go to open new session when existing already closed 15729/head
authorHaomai Wang <haomai@xsky.com>
Tue, 13 Jun 2017 02:19:55 +0000 (10:19 +0800)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Fri, 16 Jun 2017 12:31:16 +0000 (16:31 +0400)
Fixes: http://tracker.ceph.com/issues/20230
Signed-off-by: Haomai Wang <haomai@xsky.com>
(cherry picked from commit 99f580a3959240f99061a9ad48ec591b39a9fd46)

src/msg/async/AsyncConnection.cc

index fc4b75197cf2c16da4fa3ff1d0d6a1dca7383ba0..4c8c328fc056db5af49fcbcf3b6113fd4b05824d 100644 (file)
@@ -1510,8 +1510,15 @@ ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlis
     // connection's lock
     existing->lock.lock();  // skip lockdep check (we are locking a second AsyncConnection here)
 
-    if (existing->replacing || existing->state == STATE_CLOSED) {
-      ldout(async_msgr->cct, 1) << __func__ << " existing racing replace or mark_down happened while replacing."
+    if (existing->state == STATE_CLOSED) {
+      ldout(async_msgr->cct, 1) << __func__ << " existing already closed." << dendl;
+      existing->lock.unlock();
+      existing = NULL;
+      goto open;
+    }
+
+    if (existing->replacing) {
+      ldout(async_msgr->cct, 1) << __func__ << " existing racing replace happened while replacing."
                                 << " existing_state=" << get_state_name(existing->state) << dendl;
       reply.global_seq = existing->peer_global_seq;
       r = _reply_accept(CEPH_MSGR_TAG_RETRY_GLOBAL, connect, reply, authorizer_reply);