From e14b8bb7a93faafd795c4c15ade429a0782571c9 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 16 Apr 2025 12:00:50 +0530 Subject: [PATCH] mgr/vol: handle exception when path for lstat() goes missing It might happen that clone index entry goes missing because a clone job was completed or cancelled. In such a case, lstat() to clone entry's path would fail. Catch the exception in such a case and handle it so that clone progress reporter thread doesn't crash. Crashing of clone progress reporter thread causes clone progress bars to not be removed from "ceph status" output when they should, resulting in these bars to being in stuck in the output forever. Fixes: https://tracker.ceph.com/issues/70941 Signed-off-by: Rishabh Dave --- src/pybind/mgr/volumes/fs/operations/clone_index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/volumes/fs/operations/clone_index.py b/src/pybind/mgr/volumes/fs/operations/clone_index.py index f8ab7e2b294e5..6002c40af712c 100644 --- a/src/pybind/mgr/volumes/fs/operations/clone_index.py +++ b/src/pybind/mgr/volumes/fs/operations/clone_index.py @@ -59,7 +59,12 @@ class CloneIndex(Index): ens_with_ctime = [] for en in entry_names: d_path = os.path.join(self.path, en) - stb = self.fs.lstat(d_path) + try: + stb = self.fs.lstat(d_path) + except cephfs.ObjectNotFound: + log.debug(f'path {d_path} went missing, perhaps clone job was ' + 'finished') + continue # add ctime next to clone entry ens_with_ctime.append((en, stb.st_ctime)) -- 2.39.5