From b63c1a16d722bbddd6104f29014135610f470cf7 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Mon, 26 Aug 2019 13:06:04 +0800 Subject: [PATCH] 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 --- src/crimson/net/ProtocolV2.cc | 2 +- src/crimson/net/ProtocolV2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 7a4a5dab64d..eef581ff549 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 ff8973fa968..ec40bcfc408 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; -- 2.39.5