]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: fix exception handling chain with shared_future<>
authorYingxin Cheng <yingxin.cheng@intel.com>
Mon, 26 Aug 2019 05:06:04 +0000 (13:06 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 28 Aug 2019 02:16:39 +0000 (10:16 +0800)
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 <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV2.cc
src/crimson/net/ProtocolV2.h

index 7a4a5dab64d3836787e886995fd363ff307d1cda..eef581ff5495f28f4bc10471f3ffce3cf27fecf3 100644 (file)
@@ -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),
index ff8973fa968893b0abd782c6906920fb4dc5da50..ec40bcfc408d1ba7f4957be288bcdfd9dbb66cfc 100644 (file)
@@ -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;