]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/vol: handle exception when path for lstat() goes missing 61212/head
authorRishabh Dave <ridave@redhat.com>
Wed, 16 Apr 2025 06:30:50 +0000 (12:00 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 16 Apr 2025 13:53:03 +0000 (19:23 +0530)
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 <ridave@redhat.com>
src/pybind/mgr/volumes/fs/operations/clone_index.py

index f8ab7e2b294e5da9a258eb427d4e47f0629936de..6002c40af712caafaa81aef1f7fe7f8156197df9 100644 (file)
@@ -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))