From: Yingxin Cheng Date: Mon, 26 Aug 2019 05:06:04 +0000 (+0800) Subject: crimson/net: fix exception handling chain with shared_future<> X-Git-Tag: v15.1.0~1675^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b63c1a16d722bbddd6104f29014135610f470cf7;p=ceph.git crimson/net: fix exception handling chain with shared_future<> Fix the assertion failure when exception raised by sending ReconnectOk or ServerIdent at REPLACING state. Failed assertion: ceph/src/seastar/include/seastar/core/future.hh:284: void seastar::future_state_base::set_exception(std::__exception_ptr::exception_ptr&&): Assertion `_u.st == state::future' failed. Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 7a4a5dab64d3..eef581ff5495 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -1658,7 +1658,7 @@ void ProtocolV2::trigger_replacing(bool reconnect, reset_session(true); } protocol_timer.cancel(); - return std::move(execution_done); + return execution_done.get_future(); }).then([this, reconnect, new_socket = std::move(new_socket), diff --git a/src/crimson/net/ProtocolV2.h b/src/crimson/net/ProtocolV2.h index ff8973fa9688..ec40bcfc408d 100644 --- a/src/crimson/net/ProtocolV2.h +++ b/src/crimson/net/ProtocolV2.h @@ -76,7 +76,7 @@ class ProtocolV2 final : public Protocol { uint64_t peer_global_seq = 0; uint64_t connect_seq = 0; - seastar::future<> execution_done = seastar::now(); + seastar::shared_future<> execution_done = seastar::now(); class Timer { double last_dur_ = 0.0;