8000 qusion eats SIGINT and SIGTERM · Issue #6 · customink/qusion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

qusion eats SIGINT and SIGTERM #6

Open
edwintorok opened this issue Apr 27, 2011 · 0 comments
Open

qusion eats SIGINT and SIGTERM #6

edwintorok opened this issue Apr 27, 2011 · 0 comments
Labels

Comments

@edwintorok
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0