From 2dbe7499ea153352545ac5d84ea7f0e018c09082 Mon Sep 17 00:00:00 2001 From: Yingxin Date: Thu, 22 Nov 2018 05:40:58 +0800 Subject: [PATCH] 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 --- src/crimson/net/SocketConnection.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 306ec60119a29..e0d4c36b9156b 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 -- 2.39.5