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:
parent
342661f05e
commit
5fb2df9144
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue