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

WIP: Implement option to force kill #288

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: Implement option to force kill #288

wants to merge 2 commits into from

Conversation

agoscinski
Copy link

@agoscinski agoscinski commented Sep 27, 2024

Do not peform stepping when force_kill command is send. This avoids getting stuck in the kill callback.

This is part of a solution for issue aiidateam/aiida-core#6524 and goes together with the PR in aiidateam/aiida-core#6575

Co-author @khsrali

Do not peform stepping when force_kill command is send.
This avoids getting stuck in the kill callback.
@khsrali khsrali marked this pull request as ready for review October 8, 2024 08:38
@khsrali khsrali requested a review from sphuber October 8, 2024 08:39
Copy link
Collaborator

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @agoscinski . Apart from one comment on the implementation, could you please add a unit test for this?

@@ -1131,6 +1131,8 @@ def kill(self, msg: Union[str, None] = None) -> Union[bool, asyncio.Future]:
Kill the process
:param msg: An optional kill message
"""
force_kill = isinstance(msg, str) and '-F' in msg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big fan of this approach. Why not add a force_kill: bool = False argument to the kill method. From aiida-core you can then pass that in the Communicator.rpc_send method

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @sphuber.
Yes yes, I thought about it, but then we have to modify many functions to pass force_kill hand in hand or even to be compatible with dict.
So far, apparently in plumpy the msg is expected to be a str, if I'm not mistaken.
I tried to keep changes minimal.. although maybe not the best approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants