]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async, v2: make the reset_recv_state() unconditional.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 6 Jun 2019 14:36:56 +0000 (16:36 +0200)
committerSage Weil <sage@redhat.com>
Fri, 19 Jul 2019 18:02:59 +0000 (13:02 -0500)
Fixes: http://tracker.ceph.com/issues/40115
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit eb8b9c50e4fa5459d32ddb4ad93d011a28f74179)

src/msg/async/ProtocolV2.cc

index 15c786ce7544393b315a904c05c1e4e0281aec28..d456dbde180ad3093eb775565d5524aa0611ba3d 100644 (file)
@@ -220,14 +220,11 @@ uint64_t ProtocolV2::discard_requeued_up_to(uint64_t out_seq, uint64_t seq) {
 }
 
 void ProtocolV2::reset_recv_state() {
-  if ((state >= AUTH_CONNECTING && state <= SESSION_RECONNECTING) ||
-      state == READY) {
-    auth_meta.reset(new AuthConnectionMeta);
-    session_stream_handlers.tx.reset(nullptr);
-    session_stream_handlers.rx.reset(nullptr);
-    pre_auth.txbuf.clear();
-    pre_auth.rxbuf.clear();
-  }
+  auth_meta.reset(new AuthConnectionMeta);
+  session_stream_handlers.tx.reset(nullptr);
+  session_stream_handlers.rx.reset(nullptr);
+  pre_auth.txbuf.clear();
+  pre_auth.rxbuf.clear();
 
   // clean read and write callbacks
   connection->pendingReadLen.reset();
@@ -2663,6 +2660,10 @@ CtPtr ProtocolV2::reuse_connection(AsyncConnectionRef existing,
 
   ldout(messenger->cct, 5) << __func__ << " stop myself to swap existing"
                            << dendl;
+
+  std::swap(exproto->session_stream_handlers, session_stream_handlers);
+  exproto->auth_meta = auth_meta;
+
   // avoid _stop shutdown replacing socket
   // queue a reset on the new connection, which we're dumping for the old
   stop();
@@ -2672,8 +2673,6 @@ CtPtr ProtocolV2::reuse_connection(AsyncConnectionRef existing,
   exproto->can_write = false;
   exproto->reconnecting = reconnecting;
   exproto->replacing = true;
-  std::swap(exproto->session_stream_handlers, session_stream_handlers);
-  exproto->auth_meta = auth_meta;
   existing->state_offset = 0;
   // avoid previous thread modify event
   exproto->state = NONE;