Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aiida/engine/processes/calcjobs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Transport tasks for calculation jobs."""
import asyncio
import functools
import logging
import tempfile
Expand Down Expand Up @@ -406,7 +407,7 @@ async def execute(self) -> plumpy.process_states.State: # type: ignore[override
else:
logger.warning(f'killed CalcJob<{node.pk}> but async future was None')
raise
except (plumpy.process_states.Interruption, plumpy.futures.CancelledError):
except (plumpy.process_states.Interruption, plumpy.futures.CancelledError, asyncio.CancelledError):
node.set_process_status(f'Transport task {command} was interrupted')
raise
else:
Expand Down
4 changes: 4 additions & 0 deletions aiida/engine/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def do_open():
try:
transport_request.count += 1
yield transport_request.future
except asyncio.CancelledError: # pylint: disable=try-except-raise
# note this is only required in python<=3.7,
# where asyncio.CancelledError inherits from Exception
raise
except Exception:
_LOGGER.error('Exception whilst using transport:\n%s', traceback.format_exc())
raise
Expand Down
5 changes: 5 additions & 0 deletions aiida/manage/external/rmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
###########################################################################
# pylint: disable=cyclic-import
"""Components to communicate tasks to RabbitMQ."""
import asyncio
from collections.abc import Mapping
import logging
import traceback
Expand Down Expand Up @@ -209,6 +210,10 @@ async def _continue(self, communicator, pid, nowait, tag=None):
message = 'the class of the process could not be imported.'
self.handle_continue_exception(node, exception, message)
raise
except asyncio.CancelledError: # pylint: disable=try-except-raise
# note this is only required in python<=3.7,
# where asyncio.CancelledError inherits from Exception
raise
except Exception as exception:
message = 'failed to recreate the process instance in order to continue it.'
self.handle_continue_exception(node, exception, message)
Expand Down