]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: move remote reset after waiting
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 25 Nov 2022 01:31:20 +0000 (09:31 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 8 Feb 2023 06:07:41 +0000 (14:07 +0800)
And only dispatch the remote reset when the connection is still valid.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV2.cc

index 4f6e113bc809695a1031aeda1a24a130b4a8dc89..b4097c3f844683cbdad4dfcdfc6a851d63a11663 100644 (file)
@@ -1589,20 +1589,23 @@ void ProtocolV2::trigger_replacing(bool reconnect,
                   new_conn_features, new_peer_supported_features,
                   new_peer_global_seq,
                   new_connect_seq, new_msg_seq] () mutable {
-    return wait_out_exit_dispatching().then([this, do_reset] {
-      if (do_reset) {
-        reset_session(true);
-      }
+    return wait_out_exit_dispatching(
+    ).then([this] {
       protocol_timer.cancel();
       return execution_done.get_future();
     }).then([this,
              reconnect,
+             do_reset,
              mover = std::move(mover),
              new_auth_meta = std::move(new_auth_meta),
              new_client_cookie, new_peer_name,
              new_conn_features, new_peer_supported_features,
              new_peer_global_seq,
              new_connect_seq, new_msg_seq] () mutable {
+      if (state == state_t::REPLACING && do_reset) {
+        reset_session(true);
+      }
+
       if (unlikely(state != state_t::REPLACING)) {
         return mover.socket->close(
         ).then([sock = std::move(mover.socket)] {