]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: reset the V1's session_security in proper EventCenter. 32352/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 18 Dec 2019 14:30:31 +0000 (15:30 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 22 Jan 2020 15:40:34 +0000 (16:40 +0100)
Fixes: https://tracker.ceph.com/issues/43070
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/msg/async/ProtocolV1.cc

index a7d858a34b07d28c7be97bdd389dd594230b6f1a..c5d5e021fbdb86829537cd168b7ff54179c79ffe 100644 (file)
@@ -1253,10 +1253,24 @@ void ProtocolV1::discard_out_queue() {
 
 void ProtocolV1::reset_recv_state()
 {
-  // clean up state internal variables and states
-  auth_meta.reset(new AuthConnectionMeta);
-  authorizer_more.clear();
-  session_security.reset();
+  ldout(cct, 5) << __func__ << dendl;
+
+  // execute in the same thread that uses the `session_security`.
+  // We need to do the warp because holding `write_lock` is not
+  // enough as `write_event()` releases it just before calling
+  // `write_message()`. `submit_to()` here is NOT blocking.
+  connection->center->submit_to(connection->center->get_id(), [this] {
+    ldout(cct, 5) << "reset_recv_state reseting security handlers" << dendl;
+
+    // Possibly unnecessary. See the comment in `deactivate_existing`.
+    std::lock_guard<std::mutex> l(connection->lock);
+    std::lock_guard<std::mutex> wl(connection->write_lock);
+
+    // clean up state internal variables and states
+    auth_meta.reset(new AuthConnectionMeta);
+    authorizer_more.clear();
+    session_security.reset();
+  }, /* nowait = */true);
 
   // clean read and write callbacks
   connection->pendingReadLen.reset();