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+
|
# Write +str+ to +@stdout+
|
||||||
#
|
#
|
||||||
def log(str)
|
def log(str)
|
||||||
@stdout.puts format(str)
|
@stdout.puts format(str) if @stdout.respond_to? :puts
|
||||||
|
rescue Errno::EPIPE
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(str)
|
def write(str)
|
||||||
|
|
|
@ -317,7 +317,12 @@ module Puma
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
@events.unknown_error e, nil, "Exception handling servers"
|
@events.unknown_error e, nil, "Exception handling servers"
|
||||||
ensure
|
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.close
|
||||||
@notify = nil
|
@notify = nil
|
||||||
@check = nil
|
@check = nil
|
||||||
|
@ -912,7 +917,7 @@ module Puma
|
||||||
@check, @notify = Puma::Util.pipe unless @notify
|
@check, @notify = Puma::Util.pipe unless @notify
|
||||||
begin
|
begin
|
||||||
@notify << message
|
@notify << message
|
||||||
rescue IOError
|
rescue IOError, NoMethodError, Errno::EPIPE
|
||||||
# The server, in another thread, is shutting down
|
# The server, in another thread, is shutting down
|
||||||
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
|
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
|
||||||
rescue RuntimeError => e
|
rescue RuntimeError => e
|
||||||
|
|
Loading…
Reference in a new issue