Skip to content
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

Remove unnecessary SIGINT trap for Jruby #1961

Merged
merged 1 commit into from Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/puma/launcher.rb
Expand Up @@ -424,12 +424,6 @@ def setup_signals

begin
Signal.trap "SIGINT" do
if Puma.jruby?
@status = :exit
graceful_stop
exit
end

stop
end
rescue Exception
Expand Down
17 changes: 17 additions & 0 deletions test/test_integration_single.rb
Expand Up @@ -67,4 +67,21 @@ def test_term_not_accepts_new_connections
@server.close unless @server.closed?
@server = nil # prevent `#teardown` from killing already killed server
end

def test_int_signal_with_background_thread_in_jruby
skip_unless :jruby

cli_server('test/rackup/hello.ru')
begin
sock = TCPSocket.new(HOST, @tcp_port)
sock.close
rescue => ex
fail("Port didn't open properly: #{ex.message}")
end

Process.kill :INT, @server.pid
Process.wait @server.pid

assert_raises(Errno::ECONNREFUSED) { TCPSocket.new(HOST, @tcp_port) }
end
end