]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
pybind/cephfs, mgr/volumes: refactor purge() to be non-recursive
authorRishabh Dave <ridave@redhat.com>
Fri, 13 Jun 2025 07:13:51 +0000 (12:43 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 11 Sep 2025 13:56:11 +0000 (19:26 +0530)
commitf9046ca052d10a884a59c1d928cb0c8f0235696b
treecd0c79b2abbe91934086684f26c122a97f971a16
parent8b6b20b68e056dede5a267dbc85199876b9e9016
pybind/cephfs, mgr/volumes: refactor purge() to be non-recursive

Method purge() in trash.py calls rmtree() which is recursive method. To
avoid Python's recurision limit, switch to non-recursive approach.

Path to directory along directory handle are clubbed in to a tuple and
that tuple is stored on the stack. Storing directory handle reduces call
to opendir() dramatically.

Fixes: https://tracker.ceph.com/issues/71648
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/cephfs/cephfs.pyx
src/pybind/mgr/volumes/fs/operations/trash.py