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 2, 2021
1 parent f8acac1 commit 6d49be0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/puma/server.rb
Expand Up @@ -375,15 +375,15 @@ 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?
io = nil
rescue Errno::EBADF, RuntimeError
end
end
@notify.close
@notify = nil
@check = nil
end

@events.fire :state, :done
Expand Down

0 comments on commit 6d49be0

Please sign in to comment.