Skip to content

Conversation

@tecki
Copy link

@tecki tecki commented Oct 27, 2025

in an non-interactive IOC, we wait for a SIGINT or SIGTERM to finish. For the asyncio dispatcher, this means we stop the asyncio event loop.

It may, however, happen, that the asyncio event loop refuses to quit. In this case we can only SIGKILL the process, which is unnecessarily brutal. While not quitting the event loop althouggh we ask for it certainly is a bug, bugs like that do happen.

This patch resets the signal handlers for SIGINT and SIGTERM to their default action after we have politely asked the event loop to quit, such that we can insist on quitting later.

in an non-interactive IOC, we wait for a SIGINT or SIGTERM to finish. For the asyncio dispatcher, this means we stop the asyncio event loop.

It may, however, happen, that the asyncio event loop refuses to quit. In this case we can only SIGKILL the process, which is unnecessarily brutal. While not quitting the event loop althouggh we ask for it certainly is a bug, bugs like that do happen.

This patch resets the signal handlers for SIGINT and SIGTERM to their default action after we have politely asked the event loop to quit, such that we can insist on quitting later.
@Araneidae
Copy link
Collaborator

Araneidae commented Oct 27, 2025

For what it's worth, SIGQUIT (bound to Ctrl-\) remains available. This does seem a reasonable patch, will discuss with @AlexanderWells-diamond when he is back.

Doing the same for cothread would involve patching cothread itself, so would not be part of this PR.

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.

2 participants