]> 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>
Tue, 7 Oct 2025 16:27:20 +0000 (21:57 +0530)
commit9fa0e8ecdebed42b0f96cfe25ac40dcb8a4b9628
tree5f9b9b959e4d3f40cb147cfdb824e31353f199c7
parent84d292fee191ed7071162f057e7209232c6534db
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>
(cherry picked from commit f9046ca052d10a884a59c1d928cb0c8f0235696b)
src/pybind/cephfs/cephfs.pyx
src/pybind/mgr/volumes/fs/operations/trash.py