1. thread 1 call AsyncConnection::accept and create file event
2. the owner thread of connection is waked from file event
3. then this connection is closed soon
4. thread 1 dispatch reader event
5. the owner thread will crash because of a closed connection
Fix #14566
Signed-off-by: Haomai Wang <haomai@xsky.com>
ldout(async_msgr->cct, 10) << __func__ << " sd=" << incoming << dendl;
assert(sd < 0);
+ Mutex::Locker l(lock);
sd = incoming;
state = STATE_ACCEPTING;
center->create_file_event(sd, EVENT_READABLE, read_handler);