]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd-mirror: ensure instance replayer is stoped before destructing
authorJason Dillaman <dillaman@redhat.com>
Fri, 4 May 2018 13:23:27 +0000 (09:23 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 10 May 2018 11:44:29 +0000 (07:44 -0400)
Fixes: http://tracker.ceph.com/issues/24008
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 9ba94f303072374b5c7c9265c3a493fddce2f8ca)

src/tools/rbd_mirror/PoolReplayer.cc

index 90d04868a4a5ac08994e489beffc0c804d99cdab..7dee40a30b832661d9f1835d9d7d170e54744b9b 100644 (file)
@@ -377,17 +377,18 @@ void PoolReplayer<I>::shut_down() {
   }
   if (m_leader_watcher) {
     m_leader_watcher->shut_down();
-    m_leader_watcher.reset();
   }
   if (m_instance_watcher) {
     m_instance_watcher->shut_down();
-    m_instance_watcher.reset();
   }
   if (m_instance_replayer) {
     m_instance_replayer->shut_down();
-    m_instance_replayer.reset();
   }
 
+  m_leader_watcher.reset();
+  m_instance_watcher.reset();
+  m_instance_replayer.reset();
+
   assert(!m_image_map);
   assert(!m_image_deleter);
   assert(!m_local_pool_watcher);
@@ -529,6 +530,8 @@ void PoolReplayer<I>::run()
       m_cond.WaitInterval(m_lock, utime_t(1, 0));
     }
   }
+
+  m_instance_replayer->stop();
 }
 
 template <typename I>