]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: allow the tls interrupt_cond to exist when a continuation starts...
authorXuehan Xu <xxhdx1985126@gmail.com>
Mon, 16 Aug 2021 16:16:10 +0000 (00:16 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Tue, 17 Aug 2021 04:18:56 +0000 (12:18 +0800)
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>
src/crimson/common/interruptible_future.h

index 8fdbd03cf2e681a3f36aebbfc8146fafa2d0f276..e6c237bbc792ba0a5f087579886dbd85a0a844e9 100644 (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(