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

Make interchange threads daemons for less-hangy exit #2637

Merged
merged 2 commits into from Apr 7, 2023

Conversation

benclifford
Copy link
Collaborator

@benclifford benclifford commented Mar 30, 2023

When the interchange is killed by SIGINT/Ctrl-C, the main thread exits (due to a SIGINT generated KeyboardInterrupt exception) but the other two interchange threads do not. This means that the interchange process hangs without exiting.

With the behaviour introduced by this PR, the main thread ending will now cause the (now daemon) threads to end too.

This behaviour is different from the SIGTERM behaviour (which is how a clean parsl shutdown happens) - a SIGTERM kills all threads without opportunity for catching the exit, in the current signal handler configuration.

To recreate:

run:

pytest parsl/tests/ --config parsl/tests/configs/htex_local_alternate.py  -k 'not cleannet'

press ctrl-C after a while

observe a hang and that the interchange process is still alive.

After this PR,

observe a hang and that the interchange process has terminated.

The pytest hang in this post-PR situation comes from a couple of other places at least, that this PR does not address, but it's no longer in the interchange.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

When the interchange is killed by SIGINT/Ctrl-C, the main thread exits
(due to a SIGINT generated KeyboardInterrupt exception) but the other
two interchange threads do not. This means that the interchange process
hangs without exiting.

With the behaviour introduced by this PR, the main thread ending will
now cause the (now daemon) threads to end too.

This behaviour is different from the SIGTERM behaviour (which is how
a clean parsl shutdown happens) - a SIGTERM kills all threads without
opportunity for catching the exit, in the current signal handler
configuration.
@benclifford benclifford merged commit 4a4c94e into master Apr 7, 2023
5 checks passed
@benclifford benclifford deleted the benc-interchange-daemons branch April 7, 2023 13:09
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.

None yet

1 participant