If we don't cancel stacks, ops might not be destructed, so ops callbacks
could still be active.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
return 0;
}
+void RGWCoroutinesStack::cancel()
+{
+ while (!ops.empty()) {
+ RGWCoroutine *op = *pos;
+ unwind(-ECANCELED);
+ op->put();
+ }
+ put();
+}
bool RGWCoroutinesStack::collect(RGWCoroutine *op, int *ret, RGWCoroutinesStack *skip_stack) /* returns true if needs to be called again */
{
for (auto stack : context_stacks) {
ldout(cct, 20) << "clearing stack on run() exit: stack=" << (void *)stack << " nref=" << stack->get_nref() << dendl;
- stack->put();
+ stack->cancel();
}
run_contexts.erase(run_context);
lock.unlock();
bool collect(int *ret, RGWCoroutinesStack *skip_stack); /* returns true if needs to be called again */
+ void cancel();
+
RGWAioCompletionNotifier *create_completion_notifier();
RGWCompletionManager *get_completion_mgr();