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)
{
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) {