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

Purge interrupt queue when closing socket fails #1553

Merged
Merged
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
12 changes: 10 additions & 2 deletions lib/puma/server.rb
Expand Up @@ -220,7 +220,11 @@ def handle_servers_lopez_mode
# nothing
rescue Errno::ECONNABORTED
# client closed the socket even before accept
io.close rescue nil
begin
io.close
rescue
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
end
end
end
end
Expand Down Expand Up @@ -372,7 +376,11 @@ def handle_servers
# nothing
rescue Errno::ECONNABORTED
# client closed the socket even before accept
io.close rescue nil
begin
io.close
rescue
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
end
end
end
end
Expand Down