port(-1), lock("AsyncConnection::lock"), open_write(false), keepalive(false), recv_buf(NULL),
recv_max_prefetch(MIN(msgr->cct->_conf->ms_tcp_prefetch_max_size, TCP_PREFETCH_MIN_SIZE)),
recv_start(0), recv_end(0), stop_lock("AsyncConnection::stop_lock"),
- got_bad_auth(false), authorizer(NULL), replacing(false),
+ got_bad_auth(false), authorizer(NULL), replacing(false), once_session_reset(false),
state_buffer(NULL), state_offset(0), net(cct), center(c)
{
read_handler.reset(new C_handle_read(this));
assert(connect.connect_seq > existing->connect_seq);
assert(connect.global_seq >= existing->peer_global_seq);
if (policy.resetcheck && // RESETSESSION only used by servers; peers do not reset each other
- existing->connect_seq == 0) {
+ existing->connect_seq == 0 && once_session_reset) {
ldout(async_msgr->cct, 0) << __func__ << " accept we reset (peer sent cseq "
<< connect.connect_seq << ", " << existing << ".cseq = "
<< existing->connect_seq << "), sending RESETSESSION" << dendl;
+ once_session_reset = false;
return _reply_accept(CEPH_MSGR_TAG_RESETSESSION, connect, reply, authorizer_reply);
}
in_seq = 0;
connect_seq = 0;
in_seq_acked = 0;
+ once_session_reset = true;
}
// *note: `async` is true only happen when replacing connection process