From b37be02620e426935d821050109bd65587f42277 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 6 Jul 2023 15:38:49 +0800 Subject: [PATCH] client: check the xlists in ~MetaSession() This will crash the clients more gracefully instead of in ~xlist(), and this will be easier to debug the root cause and get to know exactly which list is not empty. Fixes: https://tracker.ceph.com/issues/56698 Signed-off-by: Xiubo Li (cherry picked from commit 687d4b77e5615e4a76da862c1286eb1d6bb9f559) --- src/client/MetaSession.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/MetaSession.h b/src/client/MetaSession.h index ad74ae58af2..301306263e6 100644 --- a/src/client/MetaSession.h +++ b/src/client/MetaSession.h @@ -62,6 +62,13 @@ struct MetaSession { MetaSession(mds_rank_t mds_num, ConnectionRef con, const entity_addrvec_t& addrs) : mds_num(mds_num), con(con), addrs(addrs) { } + ~MetaSession() { + ceph_assert(caps.empty()); + ceph_assert(dirty_list.empty()); + ceph_assert(flushing_caps.empty()); + ceph_assert(requests.empty()); + ceph_assert(unsafe_requests.empty()); + } xlist &get_dirty_list() { return dirty_list; } -- 2.47.3