inject_delay();
if (existing->policy.lossy) {
// disconnect from the Connection
- existing->dispatch_queue->queue_reset(this);
ldout(async_msgr->cct, 1) << __func__ << " replacing on lossy channel, failing existing" << dendl;
existing->_stop();
+ existing->dispatch_queue->queue_reset(existing.get());
} else {
assert(can_write == WriteStatus::NOWRITE);
existing->write_lock.Lock(true);
- // queue a reset on the new connection, which we're dumping for the old
- dispatch_queue->queue_reset(this);
// reset the in_seq if this is a hard reset from peer,
// otherwise we respect our original connection's value
ldout(async_msgr->cct, 1) << __func__ << " stop myself to swap existing" << dendl;
_stop();
+ // queue a reset on the new connection, which we're dumping for the old
+ dispatch_queue->queue_reset(this);
existing->lock.Unlock();
return 0;
}
if (policy.lossy && !(state >= STATE_CONNECTING && state < STATE_CONNECTING_READY)) {
ldout(async_msgr->cct, 1) << __func__ << " on lossy channel, failing" << dendl;
- dispatch_queue->queue_reset(this);
_stop();
+ dispatch_queue->queue_reset(this);
return ;
}
state >=STATE_ACCEPTING && state <= STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH) {
ldout(async_msgr->cct, 0) << __func__ << " with nothing to send and in the half "
<< " accept state just closed" << dendl;
- dispatch_queue->queue_reset(this);
-
write_lock.Unlock();
_stop();
+ dispatch_queue->queue_reset(this);
return ;
}
reset_recv_state();