]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: don't reset m_on_start_finish in GroupReplayer::restart()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 10 Apr 2025 11:44:45 +0000 (13:44 +0200)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:39 +0000 (21:26 +0530)
If restart() is called while a previous start() is still in progress,
resetting m_on_start_finish before calling stop() from inside restart()
causes on_finish that was passed to start() to be leaked.  One of the
ways this manifests in is a hang in InstanceReplayer::stop() on any
kind of shutdown -- due to InstanceReplayer::start_group_replayer()
keeping track of its start() invocations through C_TrackedOp

  group_replayer->start(new C_TrackedOp(m_async_op_tracker, nullptr),
                        false, false);

and flushing m_async_op_tracker in InstanceReplayer::stop().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/tools/rbd_mirror/GroupReplayer.cc

index d97a3511decf6058128b156743b05158ce50016e..b21e6edbf8c004e9ba8bac41f56bd7be0cca2998 100644 (file)
@@ -452,7 +452,6 @@ void GroupReplayer<I>::restart(Context *on_finish) {
   {
     std::lock_guard locker{m_lock};
     m_restart_requested = true;
-    m_on_start_finish = nullptr;
   }
 
   auto ctx = new LambdaContext(