From 8bceb47531c6988fac4a40ba8c7b95bce8cfac63 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Tue, 17 Aug 2021 00:16:10 +0800 Subject: [PATCH] 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 --- src/crimson/common/interruptible_future.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index 8fdbd03cf2e..e6c237bbc79 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( -- 2.39.5