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

server.rb - rescue handling (Errno::EBADF) for @notify.close (#2745)

This commit is contained in:
MSP-Greg 2021-11-03 18:31:07 -05:00 committed by GitHub
parent 09f2a893f8
commit 8833ca4bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,13 +375,14 @@ module Puma
rescue Exception => e
@events.unknown_error e, nil, "Exception handling servers"
ensure
begin
@check.close unless @check.closed?
rescue Errno::EBADF, RuntimeError
# RuntimeError is Ruby 2.2 issue, can't modify frozen IOError
# Errno::EBADF is infrequently raised
# RuntimeError is Ruby 2.2 issue, can't modify frozen IOError
# Errno::EBADF is infrequently raised
[@check, @notify].each do |io|
begin
io.close unless io.closed?
rescue Errno::EBADF, RuntimeError
end
end
@notify.close
@notify = nil
@check = nil
end