]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: go to open new session when existing already closed 15645/head
authorHaomai Wang <haomai@xsky.com>
Tue, 13 Jun 2017 02:19:55 +0000 (10:19 +0800)
committerHaomai Wang <haomai@xsky.com>
Tue, 13 Jun 2017 14:44:06 +0000 (22:44 +0800)
Fixes: http://tracker.ceph.com/issues/20230
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/AsyncConnection.cc

index 5418abaa0ea860d92e0cbc75928852f57b5e3470..822dc42771e3677d438c513daaaf961b2307b02e 100644 (file)
@@ -1538,8 +1538,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);