Skip to content

Commit

Permalink
server.rb - fix @notify.close
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Nov 3, 2021
1 parent 8ffe049 commit e44415a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/puma/server.rb
Expand Up @@ -375,13 +375,14 @@ def handle_servers
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
Expand Down

0 comments on commit e44415a

Please sign in to comment.