msg/async: don't stuck into resetsession/retrysession loop

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>
This commit is contained in:
Haomai Wang 2017-08-26 22:09:54 -07:00
parent 64dcb9c3d0
commit 4be0235d74

View 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);