1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Purge interrupt queue when closing socket fails (#1553)

This workaround for https://bugs.ruby-lang.org/issues/13632 was applied
to all places where IOError is rescued explicitly, but the inline
`rescue nil` here will also catch IOError and needs the fix too.
This commit is contained in:
Eugene Kenny 2018-04-02 15:03:54 +01:00 committed by Nate Berkopec
parent 342661f05e
commit 5fb2df9144

View file

@ -220,7 +220,11 @@ module Puma
# 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
@ -372,7 +376,11 @@ module Puma
# 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