From: Yingxin Date: Fri, 28 Dec 2018 02:37:30 +0000 (+0800) Subject: crimson/net: no exception forwarded from accetp/connect to send_ready X-Git-Tag: v14.1.0~481^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b4bc2f5671005e562d3d70d9c11a54a5aed0b6f;p=ceph.git crimson/net: no exception forwarded from accetp/connect to send_ready Signed-off-by: Yingxin --- diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 6c0766006cdc..789c0ac7936e 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -813,11 +813,6 @@ SocketConnection::start_connect(const entity_addr_t& _peer_addr, return seastar::repeat([this] { return repeat_connect(); }); - }).then_wrapped([this] (auto fut) { - // TODO: do not forward the exception - // and let the reconnect happen transparently inside connection - // satisfy the handshake's promise - fut.forward_to(std::move(h.promise)); }).then([this] { // notify the dispatcher and allow them to reject the connection return dispatcher.ms_handle_connect(this); @@ -826,6 +821,7 @@ SocketConnection::start_connect(const entity_addr_t& _peer_addr, }).handle_exception([this] (std::exception_ptr eptr) { // TODO: handle fault in the connecting state logger().warn("{} connecting fault: {}", *this, eptr); + h.promise.set_value(); close(); }); }); @@ -867,11 +863,6 @@ SocketConnection::start_accept(seastar::connected_socket&& fd, return seastar::repeat([this] { return repeat_handle_connect(); }); - }).then_wrapped([this] (auto fut) { - // TODO: do not forward the exception - // and let the reconnect happen transparently inside connection - // satisfy the handshake's promise - fut.forward_to(std::move(h.promise)); }).then([this] { // notify the dispatcher and allow them to reject the connection return dispatcher.ms_handle_accept(this); @@ -882,6 +873,7 @@ SocketConnection::start_accept(seastar::connected_socket&& fd, }).handle_exception([this] (std::exception_ptr eptr) { // TODO: handle fault in the accepting state logger().warn("{} accepting fault: {}", *this, eptr); + h.promise.set_value(); close(); }); }); @@ -892,6 +884,8 @@ SocketConnection::execute_open() { logger().debug("{} trigger open, was {}", *this, static_cast(state)); state = state_t::open; + // satisfy the handshake's promise + h.promise.set_value(); seastar::with_gate(pending_dispatch, [this] { // start background processing of tags read_tags_until_next_message();