]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete finisher only after finalizing watches 6164/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 26 Aug 2015 22:08:18 +0000 (15:08 -0700)
committerLoic Dachary <ldachary@redhat.com>
Fri, 2 Oct 2015 15:11:11 +0000 (17:11 +0200)
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>
(cherry picked from commit 97aed59fb9e865d30d31d2b7f4e93fc9727c96fa)

src/rgw/rgw_rados.cc

index e71f6a2a65161639745955f15829b2fdc4786861..3266eda23a0ea9e17e4b61f0ce1487f1cec46c96 100644 (file)
@@ -1433,11 +1433,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) {