]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: catch CancelledError in asyncio timeout handler 56086/head
authorAdam King <adking@redhat.com>
Fri, 16 Feb 2024 16:24:32 +0000 (11:24 -0500)
committerAdam King <adking@redhat.com>
Wed, 13 Mar 2024 14:41:21 +0000 (10:41 -0400)
commit41f1f010297aada2fd87ee6881abf6a77bcc4c0d
tree6acda81f22b415a4ec72edaccea77f18c80d7a82
parentfe1c2d679c5ef0de1d897384703ded64d5617446
mgr/cephadm: catch CancelledError in asyncio timeout handler

Specifically, concurrent.futures.CancelledError. At least on
python 3.9, this error can be raised when certain commands
being run asynchronously fail. Not catching this results in
the whole cephadm module crashing with something like

Traceback (most recent call last):
  File "/usr/share/ceph/mgr/cephadm/utils.py", line 94, in do_work
    return f(*arg)
  File "/usr/share/ceph/mgr/cephadm/serve.py", line 267, in refresh
    r = self._refresh_facts(host)
  File "/usr/share/ceph/mgr/cephadm/serve.py", line 370, in _refresh_facts
    val = self.mgr.wait_async(self._run_cephadm_json(
  File "/usr/share/ceph/mgr/cephadm/module.py", line 671, in wait_async
    return self.event_loop.get_result(coro, timeout)
  File "/usr/share/ceph/mgr/cephadm/ssh.py", line 64, in get_result
    return future.result(timeout)
  File "/lib64/python3.9/concurrent/futures/_base.py", line 444, in result
    raise CancelledError()
concurrent.futures._base.CancelledError

Fixes: https://tracker.ceph.com/issues/64473
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 9c34973932bf3a0ec50c1c63bcba5e35bfe407e5)
src/pybind/mgr/cephadm/module.py