From: Radoslaw Zarzynski Date: Wed, 18 Dec 2019 14:30:31 +0000 (+0100) Subject: msg/async: reset the V1's session_security in proper EventCenter. X-Git-Tag: v15.1.0~54^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6548dbcf30d5f880ad789560235688eef0cf2b56;p=ceph.git msg/async: reset the V1's session_security in proper EventCenter. Fixes: https://tracker.ceph.com/issues/43070 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index a7d858a34b07..c5d5e021fbdb 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -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 l(connection->lock); + std::lock_guard 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();