]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/vol: handle case where clone index entry goes missing
authorRishabh Dave <ridave@redhat.com>
Mon, 17 Jun 2024 19:03:28 +0000 (00:33 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 11 Jul 2024 16:33:21 +0000 (22:03 +0530)
commit3cff7251c86a4670768721f924b11b3de33f807b
tree8865cfc63268290a9d17dba3201aebdace2bf63e
parentd622325c17bb98672ad22e60a372becfbeb04cff
mgr/vol: handle case where clone index entry goes missing

In `async_cloner.py`, clone index entry is fetched to get next clone job
that needs to be executed. It might happen that the clone job was
cancelled just when it was going to be picked for execution (IOW, when
it was about to move from pending state to in-progress state).

Currently, MGR hangs in such a case because exception `ObjectNotFound`
from CephFS Python bindings is raised and is left uncaught. To prevent
this issue catch the exception, log it and return None to tell
`get_job()` of `async_job.py` to look for next job in the queue.

Increase the scope of try-except in method `get_oldest_clone_entry()` of
`async_cloner.py` so that when exception `cephfs.Error` or any exception
under it is thrown by `self.fs.lstat()` is not left uncaught.

FS object is also passed to the method `list_one_entry_at_a_time()`, so
increasing scope of try-except is useful as it will not allow exceptions
raised in other calls to CephFS Python binding methods to be left
uncaught.

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