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

handle keyboard interrupts #37

Closed
nsheff opened this issue Jun 20, 2018 · 4 comments
Closed

handle keyboard interrupts #37

nsheff opened this issue Jun 20, 2018 · 4 comments
Milestone

Comments

@nsheff
Copy link
Contributor

nsheff commented Jun 20, 2018

when proceeding under local compute mode, looper should more gracefully handle keyboard interrupts, passing them on the to command it was running and allowing that command a few seconds to shut itself down before terminating.

@donaldcampbelljr
Copy link
Contributor

A quick internet search suggests that we could wrap any major loops in Try Excepts where the exception to handle is KeyboardInterrupt:

try:
  looping_over_looper_samples()
except KeyboardInterrupt:
  Clean up and Exit code

@donaldcampbelljr
Copy link
Contributor

The above suggestion is not quite what is desired. We want to have looper send a weak kill signal to the subprocess that it has spawned (e.g. the pipeline). PyPiper actually currently has a way of sending a weak kill signal (SIGTERM) and waiting a few seconds before sending the SIGKILL to the pipeline.

@donaldcampbelljr
Copy link
Contributor

Ok, I've lifted some of the code from PyPiper and now have this working in Looper with simple testing.

@nsheff
Copy link
Contributor Author

nsheff commented Jun 10, 2024

excellent!

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

2 participants