crimson/common: allow the tls interrupt_cond to exist when a continuation starts to run

Release build of seastar invokes continuations synchronously if their predecessor futures
are resolved at the time when those continuations are constructed, so we have to allow
these circumstances to happen

Fixes: https://tracker.ceph.com/issues/52275
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
This commit is contained in:
Xuehan Xu 2021-08-17 00:16:10 +08:00
parent 52e28c4c39
commit 8bceb47531

View File

@ -117,14 +117,18 @@ auto call_with_interruption_impl(
// need to be interrupted, return an interruption; otherwise, restore the
// global "interrupt_cond" with the interruption condition, and go ahead
// executing the Func.
if (!interrupt_cond<InterruptCond> && interrupt_condition) {
if (interrupt_condition) {
auto [interrupt, fut] = interrupt_condition->template may_interrupt<
typename futurator_t::type>();
if (interrupt) {
return std::move(*fut);
}
set_int_cond = true;
interrupt_cond<InterruptCond> = interrupt_condition;
if (!interrupt_cond<InterruptCond>) {
set_int_cond = true;
interrupt_cond<InterruptCond> = interrupt_condition;
}
ceph_assert(interrupt_cond<InterruptCond>.get()
== interrupt_condition.get());
}
auto fut = seastar::futurize_invoke(