aiida-core
aiida-core copied to clipboard
WIP: Implement force-kill option in verdi process kill
This allows plumpy ignore the callback so it does not get stuck in it but directly transitions the process to killed. The disadvantage is that the job behind the process might not be killed as we do not wait for. But I think that can be clearly communicated to the user in the help message and it has a similar logic as kill -9 <PID>
.
This PR goes together with the PR in plumpy https://github.com/aiidateam/plumpy/pull/288
TODO:
As you feared @khsrali with this solution the worker process will not be killed, so the upload async function still continues, so maybe we still need to find a solution that actually sends the message back to aiida-core. It is really weird, I feel like _stepping
part in plumpy is buggy, because it only the transition function actually returns back to the sender of the message (where verdi process kill <PID>
was sent), while only call the callback do calcjobs.tasks.task_kill_job
in the _stepping part kills the process occupying the worker (when removing the exponential backof from the kill), but it should do both. I have this a bug on my system also when just killing local jobs that sleep. Maybe we can check on your machine.
Co-author @khsrali