This commit introduced regressions, issues #14173, #14180.
The problem is that the context deletes itself after execution,
so using a shared_ptr to hold it is problematic, as we'll eventually
have a double free. Also, it doesn't solve the underlying leak issue.
This reverts commit
e9daed221e7c6fd84aef78c3d5fc18470b916fcb.
watcher->reinit();
}
};
- shared_ptr<C_ReinitWatch> reinit_watch;
public:
RGWWatcher(RGWRados *r, int i, const string& o) : rados(r), index(i), oid(o), watch_handle(0) {}
void handle_notify(uint64_t notify_id,
lderr(rados->ctx()) << "RGWWatcher::handle_error cookie " << cookie
<< " err " << cpp_strerror(err) << dendl;
rados->remove_watcher(index);
- reinit_watch.reset(new C_ReinitWatch(this));
- rados->schedule_context(reinit_watch.get());
+ rados->schedule_context(new C_ReinitWatch(this));
}
void reinit() {