Repository navigation
SIGTERM is now graceful, the same as SIGINT. - #50
Merged
Merged
Conversation
samuel-williams-shopify
force-pushed
the
graceful-terminate
branch
from
February 3, 2026 09:08
f9f1055 to
d7adc72
Compare
samuel-williams-shopify
force-pushed
the
graceful-terminate
branch
from
February 3, 2026 18:14
57f83c2 to
9f6133b
Compare
samuel-williams-shopify
force-pushed
the
graceful-terminate
branch
from
February 3, 2026 18:49
af20806 to
15d0b97
Compare
samuel-williams-shopify
force-pushed
the
graceful-terminate
branch
from
February 3, 2026 19:27
a91391b to
93cec86
Compare
tavianator
reviewed
Feb 3, 2026
| # $stderr.puts "Received TERM signal, terminating...", caller | ||
| ::Thread.current.raise(Terminate) | ||
| # $stderr.puts "Received TERM signal, interrupting...", caller | ||
| ::Thread.current.raise(Interrupt) # Same as SIGINT |
There was a problem hiding this comment.
Why not change the rescue Terminate block instead of changing the raised exception?
Contributor
Author
There was a problem hiding this comment.
It may be possible, but Async itself specifically handles Interrupt differently from Terminate.
Interrupt triggers a graceful stop of the Async scheduler: https://github.com/socketry/async/blob/400bc2e1fedcaa72ae1fa86d5c8d7e1962c1f889/lib/async/scheduler.rb#L534-L543
I think we want to preserve this behaviour, and if we raised Terminate it would cause an ungraceful exit.
Later on, I think we can revisit this if necessary.
ioquatix
reviewed
Feb 4, 2026
ioquatix
reviewed
Feb 4, 2026
ioquatix
reviewed
Feb 4, 2026
ioquatix
reviewed
Feb 4, 2026
ioquatix
reviewed
Feb 4, 2026
ioquatix
approved these changes
Feb 4, 2026
3 tasks done
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.
Fixes #49.
Types of Changes
Contribution