Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

reset signal handlers after they have fired#193

Open
tecki wants to merge 1 commit intoDiamondLightSource:masterDiamondLightSource/pythonSoftIOC:masterfrom
tecki:signal-resettecki/pythonSoftIOC:signal-resetCopy head branch name to clipboard
Open

reset signal handlers after they have fired#193
tecki wants to merge 1 commit intoDiamondLightSource:masterDiamondLightSource/pythonSoftIOC:masterfrom
tecki:signal-resettecki/pythonSoftIOC:signal-resetCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.