mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
CI fixes - lib/puma/events.rb, lib/puma/server.rb
This commit is contained in:
parent
95942e24a9
commit
0166913318
2 changed files with 9 additions and 3 deletions
|
@ -65,7 +65,8 @@ module Puma
|
|||
# Write +str+ to +@stdout+
|
||||
#
|
||||
def log(str)
|
||||
@stdout.puts format(str)
|
||||
@stdout.puts format(str) if @stdout.respond_to? :puts
|
||||
rescue Errno::EPIPE
|
||||
end
|
||||
|
||||
def write(str)
|
||||
|
|
|
@ -317,7 +317,12 @@ module Puma
|
|||
rescue Exception => e
|
||||
@events.unknown_error e, nil, "Exception handling servers"
|
||||
ensure
|
||||
@check.close unless @check.closed? # Ruby 2.2 issue
|
||||
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
|
||||
end
|
||||
@notify.close
|
||||
@notify = nil
|
||||
@check = nil
|
||||
|
@ -912,7 +917,7 @@ module Puma
|
|||
@check, @notify = Puma::Util.pipe unless @notify
|
||||
begin
|
||||
@notify << message
|
||||
rescue IOError
|
||||
rescue IOError, NoMethodError, Errno::EPIPE
|
||||
# The server, in another thread, is shutting down
|
||||
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
|
||||
rescue RuntimeError => e
|
||||
|
|
Loading…
Reference in a new issue