]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-mirror: unregister asok commands outside lock
authorVenky Shankar <vshankar@redhat.com>
Tue, 22 Sep 2020 12:24:44 +0000 (08:24 -0400)
committerVenky Shankar <vshankar@redhat.com>
Thu, 24 Sep 2020 12:18:11 +0000 (08:18 -0400)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/tools/cephfs_mirror/FSMirror.cc

index b2952cfac07c6192516ea3ff998944588cfbe260..a0bae498be12a6382c0212206b5a396a49c7d972 100644 (file)
@@ -96,10 +96,14 @@ FSMirror::FSMirror(CephContext *cct, std::string_view fs_name, uint64_t pool_id,
 FSMirror::~FSMirror() {
   dout(20) << dendl;
 
-  std::scoped_lock locker(m_lock);
-  delete m_instance_watcher;
-  delete m_mirror_watcher;
-  m_cluster.reset();
+  {
+    std::scoped_lock locker(m_lock);
+    delete m_instance_watcher;
+    delete m_mirror_watcher;
+    m_cluster.reset();
+  }
+  // outside the lock so that in-progress commands can acquire
+  // lock and finish executing.
   delete m_asok_hook;
 }