When the connection is lossy and enter fault, it will dispatch reset event.
If cleanup handler is executed as well as ms_handle_reset call mark_down,
it may exists racing for "cs". cleanup handler will reset "cs" but
_conn_prefix in mark_down will access "cs".
Signed-off-by: Haomai Wang <haomai@xsky.com>
#undef dout_prefix
#define dout_prefix _conn_prefix(_dout)
ostream& AsyncConnection::_conn_prefix(std::ostream *_dout) {
- int fd = cs ? cs.fd() : -1;
+ int fd = (cs && state != STATE_CLOSED) ? cs.fd() : -1;
return *_dout << "-- " << async_msgr->get_myinst().addr << " >> " << peer_addr << " conn(" << this
<< " sd=" << fd << " :" << port
<< " s=" << get_state_name(state)