From: Yingxin Date: Wed, 21 Nov 2018 21:40:58 +0000 (+0800) Subject: crimson/net: no open connections in accepting_conns X-Git-Tag: v14.1.0~574^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2dbe7499ea153352545ac5d84ea7f0e018c09082;p=ceph.git crimson/net: no open connections in accepting_conns It should an atomic operation to move the connection from accepting_conns to connections when switch to the open state. Signed-off-by: Yingxin --- diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 306ec60119a2..e0d4c36b9156 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -533,8 +533,6 @@ SocketConnection::send_connect_reply_ready(msgr_tag_t tag, return socket->flush(); } }).then([this] { - messenger.register_conn(this); - messenger.unaccept_conn(this); return stop_t::yes; }); } @@ -889,6 +887,8 @@ SocketConnection::accept(seastar::connected_socket&& fd, return dispatcher.ms_handle_accept(this); }); }).then([this] { + messenger.register_conn(this); + messenger.unaccept_conn(this); execute_open(); }).handle_exception([this] (std::exception_ptr eptr) { // TODO: handle fault in the accepting state