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

Try and kill a Process when running in local interpreter gets interrupted #2711

Closed
sphuber opened this issue Apr 5, 2019 · 2 comments
Closed

Comments

@sphuber
Copy link
Contributor

sphuber commented Apr 5, 2019

Currently, if a user runs a Process in a local interpreter and then interrupts the interpreter the process will be lost. However, the node will reflect the last active state. This can be confusing to new users, who will still for example see a "process" in the "Waiting" state. We should try and catch the interrupt signal and try to kill the process properly before shutting down. At the very least we should try to set an Excepted state on the node.

@marco-foscato
Copy link

Reporting experience upon suggestion from @giovannipizzi
Considering tutorial 6.5. I have run the python script (i.e., verdi run scriptname) that included the run(EquationOfState,...) call and then I "killed" it (ctrl-C followed by ctrl-Z).
Done this twice, on two independent runs. The result on the process list was the following in one case

  PK  Created    Process label    Process State    Process status
----  ---------  ---------------  ---------------  ------------------------------------
2564  16m ago    EquationOfState  ⏵ Waiting
2572  16m ago    PwCalculation    ⏵ Waiting        Waiting for transport task: update
2578  16m ago    PwCalculation    ⏵ Waiting        Waiting for transport task: update
2584  16m ago    PwCalculation    ⏵ Waiting        Waiting for transport task: update
2590  16m ago    PwCalculation    ⏵ Waiting        Waiting for transport task: retrieve
2596  16m ago    PwCalculation    ⏵ Waiting        Waiting for transport task: update

and in the other case, when I let the master script run for a shorter time than before

2604  4m ago     EquationOfState  ⏵ Running
2612  4m ago     PwCalculation    ⏹ Created
2618  4m ago     PwCalculation    ⏹ Created

@unkcpz
Copy link
Member

unkcpz commented Oct 28, 2024

In my test, the subprocess will be killed and moved to the Killed state. The parent process will then be Except process. It is matter of time to wait for event loop to gracefully run kill on all subprocess I think. I close this one, and feel free to reopen if the problem again can be reproduce.

@unkcpz unkcpz closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants