Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer the import of plumpy exception thus aiopika #6661

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all 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
5 changes: 3 additions & 2 deletions src/aiida/engine/processes/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import plumpy.processes
from kiwipy.communications import UnroutableError
from plumpy.process_states import Finished, ProcessState
from plumpy.processes import ConnectionClosed # type: ignore[attr-defined]
from plumpy.processes import Process as PlumpyProcess
from plumpy.utils import AttributesFrozendict

Expand Down Expand Up @@ -334,6 +333,8 @@ def kill(self, msg: Union[str, None] = None) -> Union[bool, plumpy.futures.Futur

:param msg: message
"""
from plumpy.exceptions import CommunicatorConnectionClosed

self.node.logger.info(f'Request to kill Process<{self.node.pk}>')

had_been_terminated = self.has_terminated()
Expand All @@ -352,7 +353,7 @@ def kill(self, msg: Union[str, None] = None) -> Union[bool, plumpy.futures.Futur
result = asyncio.wrap_future(result) # type: ignore[arg-type]
if asyncio.isfuture(result):
killing.append(result)
except ConnectionClosed:
except CommunicatorConnectionClosed:
self.logger.info('no connection available to kill child<%s>', child.pk)
except UnroutableError:
self.logger.info('kill signal was unable to reach child<%s>', child.pk)
Expand Down
Loading