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:
parent
09f2a893f8
commit
8833ca4bda
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue