]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd-mirror: do not re-register the ASOK if the image replayer isn't running
authorJason Dillaman <dillaman@redhat.com>
Thu, 27 Feb 2020 03:25:03 +0000 (22:25 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 2 Mar 2020 15:53:42 +0000 (10:53 -0500)
Avoid the possibility of a race when shutting down and post-unregister a status
update causes the ASOK to become re-registered.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/ImageReplayer.cc

index 6f6056e75ab88fb7898d27a3988a574d60390c9b..8068ef678716f419f3062440958033eaf16ed2cb 100644 (file)
@@ -1047,7 +1047,14 @@ void ImageReplayer<I>::reregister_admin_socket_hook() {
     return;
   }
 
+  dout(15) << "old_image_spec=" << m_image_spec << ", "
+           << "new_image_spec=" << image_spec << dendl;
   m_image_spec = image_spec;
+
+  if (m_state == STATE_STOPPING || m_state == STATE_STOPPED) {
+    // no need to re-register if stopping
+    return;
+  }
   locker.unlock();
 
   unregister_admin_socket_hook();