From: Haomai Wang Date: Tue, 13 Jun 2017 02:19:55 +0000 (+0800) Subject: msg/async: go to open new session when existing already closed X-Git-Tag: v12.1.0~145^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15645%2Fhead;p=ceph.git msg/async: go to open new session when existing already closed Fixes: http://tracker.ceph.com/issues/20230 Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 5418abaa0ea86..822dc42771e36 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -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);