From e4b5a327bf4c4d601be8bdd5210ae74f2eed7f28 Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Tue, 17 Sep 2024 12:20:29 +0000 Subject: [PATCH] common/gated: enable ceph_assert on shard id Checking that each call to gate on the same shard the gate assigned to. Fixes: https://tracker.ceph.com/issues/67773 Signed-off-by: Nitzan Mordechai --- src/crimson/common/gated.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crimson/common/gated.h b/src/crimson/common/gated.h index f7faef87970..28e3620e654 100644 --- a/src/crimson/common/gated.h +++ b/src/crimson/common/gated.h @@ -31,13 +31,13 @@ class Gated { template inline void dispatch_in_background(const char* what, T& who, Func&& func) { - //ceph_assert(seastar::this_shard_id() == sid); + ceph_assert(seastar::this_shard_id() == sid); (void) dispatch(what, who, std::forward(func)); } template inline seastar::future<> dispatch(const char* what, T& who, Func&& func) { - //ceph_assert(seastar::this_shard_id() == sid); + ceph_assert(seastar::this_shard_id() == sid); return seastar::with_gate(pending_dispatch, std::forward(func) ).handle_exception([what, &who] (std::exception_ptr eptr) { if (*eptr.__cxa_exception_type() == typeid(system_shutdown_exception)) { @@ -58,7 +58,7 @@ class Gated { template auto simple_dispatch(const char* what, Func&& func) { - //ceph_assert(seastar::this_shard_id() == sid); + ceph_assert(seastar::this_shard_id() == sid); return seastar::with_gate(pending_dispatch, std::forward(func)); } -- 2.39.5