You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
If qusion gem is added, then 'rails server' no longer reacts to Ctrl-C and SIGTERM.
The culprit is this code in lib/qusion.rb:
def self.die_gracefully_on_signal
Signal.trap("INT") { graceful_stop }
Signal.trap("TERM") { graceful_stop }
end
def self.graceful_stop
EM.schedule do
@graceful_stop = true
AMQP.stop { EM.stop }
end
thread && thread.join
end
Adding some logging code shows that the join happens successfully, but you don't call the old handler!
Thus you shutdown the AMQP thingy, but leave the application running. You should probably invoke the old handler (that Signal.trap returned), to make sure that rails shuts down successfully.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If qusion gem is added, then 'rails server' no longer reacts to Ctrl-C and SIGTERM.
The culprit is this code in lib/qusion.rb:
def self.die_gracefully_on_signal
Signal.trap("INT") { graceful_stop }
Signal.trap("TERM") { graceful_stop }
end
def self.graceful_stop
EM.schedule do
@graceful_stop = true
AMQP.stop { EM.stop }
end
thread && thread.join
end
Adding some logging code shows that the join happens successfully, but you don't call the old handler!
Thus you shutdown the AMQP thingy, but leave the application running. You should probably invoke the old handler (that Signal.trap returned), to make sure that rails shuts down successfully.
The text was updated successfully, but these errors were encountered: