]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWRealmWatcher::watch_restart() also unwatches watch
authorYehuda Sadeh <yehuda@redhat.com>
Sun, 17 Apr 2016 00:37:56 +0000 (17:37 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Sun, 17 Apr 2016 23:05:35 +0000 (16:05 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_realm_watcher.cc

index 6e47c48460affd1cb48c32685a9cb0b405b84f1b..d9383d6d31b5f24c7e51df2b8132f43b077503d5 100644 (file)
@@ -124,7 +124,12 @@ int RGWRealmWatcher::watch_start(RGWRealm& realm)
 int RGWRealmWatcher::watch_restart()
 {
   assert(!watch_oid.empty());
-  int r = pool_ctx.watch2(watch_oid, &watch_handle, this);
+  int r = pool_ctx.unwatch2(watch_handle);
+  if (r < 0) {
+    lderr(cct) << "Failed to unwatch on " << watch_oid
+        << " with " << cpp_strerror(-r) << dendl;
+  }
+  r = pool_ctx.watch2(watch_oid, &watch_handle, this);
   if (r < 0)
     lderr(cct) << "Failed to restart watch on " << watch_oid
         << " with " << cpp_strerror(-r) << dendl;