]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete finisher only after finalizing watches 5678/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 26 Aug 2015 22:08:18 +0000 (15:08 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 26 Aug 2015 22:08:18 +0000 (15:08 -0700)
Fixes: #12208
The watch error path might try to schedule a finisher work, delete finisher
only after watch destruction.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index b5c359fa941e111ec851c9659e430a5f39cf4795..cc0481d45452cff18105744e6ea7c590cc058f81 100644 (file)
@@ -1432,11 +1432,17 @@ void RGWRados::finalize()
 {
   if (finisher) {
     finisher->stop();
-    delete finisher;
   }
   if (need_watch_notify()) {
     finalize_watch();
   }
+  if (finisher) {
+    /* delete finisher only after cleaning up watches, as watch error path might call
+     * into finisher. We stop finisher before finalizing watch to make sure we don't
+     * actually handle any racing work
+     */
+    delete finisher;
+  }
   delete meta_mgr;
   delete data_log;
   if (use_gc_thread) {