From: Xiubo Li Date: Thu, 6 Jul 2023 07:38:49 +0000 (+0800) Subject: client: check the xlists in ~MetaSession() X-Git-Tag: v17.2.7~60^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b37be02620e426935d821050109bd65587f42277;p=ceph.git 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) --- diff --git a/src/client/MetaSession.h b/src/client/MetaSession.h index ad74ae58af2e1..301306263e66e 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; }