]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/gated: enable ceph_assert on shard id
authorNitzan Mordechai <nmordech@redhat.com>
Tue, 17 Sep 2024 12:20:29 +0000 (12:20 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Tue, 17 Sep 2024 12:24:44 +0000 (12:24 +0000)
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 <nmordech@redhat.com>
src/crimson/common/gated.h

index f7faef87970806934cc4ac3c54de919627583ca8..28e3620e65489c49677c5edfb089ce92a869060f 100644 (file)
@@ -31,13 +31,13 @@ class Gated {
 
   template <typename Func, typename T>
   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>(func));
   }
 
   template <typename Func, typename T>
   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>(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 <typename Func>
   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>(func));
   }