Skip to content

Commit e14b8bb

Browse files
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 <[email protected]>
1 parent 9f74f85 commit e14b8bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pybind/mgr/volumes/fs/operations/clone_index.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ def list_entries_by_ctime_order(self):
5959
ens_with_ctime = []
6060
for en in entry_names:
6161
d_path = os.path.join(self.path, en)
62-
stb = self.fs.lstat(d_path)
62+
try:
63+
stb = self.fs.lstat(d_path)
64+
except cephfs.ObjectNotFound:
65+
log.debug(f'path {d_path} went missing, perhaps clone job was '
66+
'finished')
67+
continue
6368

6469
# add ctime next to clone entry
6570
ens_with_ctime.append((en, stb.st_ctime))

0 commit comments

Comments
 (0)