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