From: Xuehan Xu Date: Mon, 16 Aug 2021 16:16:10 +0000 (+0800) Subject: crimson/common: allow the tls interrupt_cond to exist when a continuation starts... X-Git-Tag: v17.1.0~1101^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bceb47531c6988fac4a40ba8c7b95bce8cfac63;p=ceph.git 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 --- diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index 8fdbd03cf2e6..e6c237bbc792 100644 --- a/src/crimson/common/interruptible_future.h +++ b/src/crimson/common/interruptible_future.h @@ -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 && 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 = interrupt_condition; + if (!interrupt_cond) { + set_int_cond = true; + interrupt_cond = interrupt_condition; + } + ceph_assert(interrupt_cond.get() + == interrupt_condition.get()); } auto fut = seastar::futurize_invoke(