Dropping lock is dangerous and could be race-prone.
Any time the lock is dropped we need to reverify the connection state.
send_keepalive under the scope of lock should be just fine since
it does not introduce any extra lock dependencies.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
ceph_assert(connection->peer_addrs->msgr2_addr() >
messenger->get_myaddrs().msgr2_addr());
- existing->lock.unlock();
// make sure we follow through with opening the existing
- // connection (if it isn't yet open) since we know the peer
- // has something to send to us.
+ // connection (if it isn't yet open) since we know the peer
+ // has something to send to us.
existing->send_keepalive();
- existing->lock.lock();
auto wait = WaitFrame::Encode(session_stream_handlers);
return WRITE(wait, "wait", read_frame);
}