Redesign signal handling#220
Open
SeanTAllen wants to merge 2 commits into
Open
Conversation
jemc
reviewed
Mar 4, 2026
jemc
left a comment
Member
There was a problem hiding this comment.
I think the design thinking here is good, the only open question is if the runtime architecture changes will work as described or if they'll need to make different choices or end up exposing different properties
Member
Author
|
Here's an idea of what this would look like: https://github.com/ponylang/ponyc/pull/4984/changes |
Member
|
API design seems fine - no issues from me. As discussed in sync today, we will need a careful, detailed round of review and testing of the runtime code that involves atomics. |
The current system registers handlers with no capability gate, behaves differently per platform when two actors subscribe to the same signal (first silently wins on Linux, last on macOS), and accepts signal numbers it can never honor. This RFC redesigns the signals package around auth-gated, validated registration with multi-subscriber fan-out, reported registration failure, a completion-reporting disposed callback, and defined shutdown behavior for undisposed handlers.
896d796 to
e0d5b74
Compare
Member
Author
|
Rename ValidSignal and related to HandleableSignal. In case we add sending of signals in the future. |
Reconcile the RFC with the prototype in ponylang/ponyc#4984: SIGUSR2 is handleable on scheduler_scaling_pthreads builds, not rejected on every build. Rename the constrained-signal type family to HandleableSignal to leave room for a signal-sending validator later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposes redesigning signal handling to fix the inconsistent cross-platform behavior (first-handler-wins on Linux vs last-handler-wins on macOS) and add capability security via a new SignalAuth type. The new design supports multiple subscribers per signal, with the runtime dispatching to all registered handlers in undefined order. SignalRaise also gains an auth requirement for consistency with other I/O primitives.
Closes #170