From 97aed59fb9e865d30d31d2b7f4e93fc9727c96fa Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 26 Aug 2015 15:08:18 -0700 Subject: [PATCH] rgw: delete finisher only after finalizing watches Fixes: #12208 The watch error path might try to schedule a finisher work, delete finisher only after watch destruction. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rados.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index b5c359fa941e..cc0481d45452 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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) { -- 2.47.3