From: Adam C. Emerson Date: Wed, 26 Nov 2025 02:54:58 +0000 (-0500) Subject: neorados: Go through linger_cancel on `io_context` shutdown X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=92f24c77fa3787fd2209df92c3b5bfe0b68e990e;p=ceph-ci.git neorados: Go through linger_cancel on `io_context` shutdown Rather than just dropping the reference, clean up the linger operation properly within Objecter. Also, clear out handlers before relinquishing reference to avoid use-after-free. Signed-off-by: Adam C. Emerson --- diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index 3824e3fe6c3..79fb3d8a477 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -1397,11 +1397,16 @@ class Notifier : public async::service_list_base_hook { if (neoref) { neoref = nullptr; } - if (linger_op) { - linger_op->put(); - } std::unique_lock l(m); handlers.clear(); + l.unlock(); + if (linger_op) { + // We are being taken down and will execute no more + // handlers. Call `linger_cancel` to clean up properly in + // Objecter. (It doesn't call out to the OSD or anything.) + linger_op->objecter->linger_cancel(linger_op); + } + // We may be freed after this point. Touch nothing. } public: