-
-
Notifications
You must be signed in to change notification settings - Fork 8
SIGTERM is now graceful, the same as SIGINT.
#50
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
Changes from 10 commits
d7adc72
9f6133b
15d0b97
93cec86
dd369ab
8a7c776
90feeb6
f7dba34
f5ea9c1
8d7c28c
1ffbd30
d720869
f88b931
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,9 +134,6 @@ def restart | |
| if container.failed? | ||
| @notify&.error!("Container failed to start!") | ||
|
|
||
| Console.info(self, "Stopping failed container...") | ||
| container.stop(false) | ||
|
|
||
| raise SetupError, container | ||
| end | ||
|
|
||
|
|
@@ -151,9 +148,14 @@ def restart | |
| end | ||
|
|
||
| @notify&.ready!(size: @container.size) | ||
| rescue => error | ||
| raise | ||
| ensure | ||
| # If we are leaving this function with an exception, try to kill the container: | ||
| container&.stop(false) | ||
| # If we are leaving this function with an exception, kill the container: | ||
| if container | ||
| Console.warn(self, "Stopping failed container...", exception: error) | ||
| container.stop(false) | ||
| end | ||
| end | ||
|
|
||
| # Reload the existing container. Children instances will be reloaded using `SIGHUP`. | ||
|
|
@@ -222,9 +224,10 @@ def run | |
| ::Thread.current.raise(Interrupt) | ||
| end | ||
|
|
||
| # SIGTERM behaves the same as SIGINT by default. | ||
| terminate_action = Signal.trap(:TERM) do | ||
| # $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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not change the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may be possible, but Async itself specifically handles
I think we want to preserve this behaviour, and if we raised Later on, I think we can revisit this if necessary. |
||
| end | ||
|
|
||
| hangup_action = Signal.trap(:HUP) do | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.