Skip to content

Instantly share code, notes, and snippets.

@ender672
Created May 8, 2012 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ender672/2638291 to your computer and use it in GitHub Desktop.
Save ender672/2638291 to your computer and use it in GitHub Desktop.
# Puma hangs when it receives a SIGTERM in Linux x86_64. Reproduce as follows:
#
# Start Puma
# $ puma
#
# Get the PID for Puma
# $ ps u
#
# Send SIGTERM
# $ kill 4321
#
# Puma roughly does the following, which causes a hang in MRI and RBX. JRuby
# appears to handle this fine.
t = Thread.new{ sleep 3 } # lib/puma/server.rb:204
Signal.trap "SIGINT" do # lib/puma/cli.rb:427
t.join # lib/puma/server.rb:628
end
puts 'Press <ctrl> + c now'
t.join # in lib/puma/cli.rb:434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment