From e7f16398fc3454f372dcaf1d49b3e7fc5cb554b9 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Thu, 2 Mar 2023 10:58:24 -0600 Subject: [PATCH] Loggers - internal_write - catch Errno::EINVAL --- lib/puma/error_logger.rb | 3 ++- lib/puma/log_writer.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/puma/error_logger.rb b/lib/puma/error_logger.rb index fbd569ee36..b48f53577d 100644 --- a/lib/puma/error_logger.rb +++ b/lib/puma/error_logger.rb @@ -102,7 +102,8 @@ def internal_write(str) @ioerr.is_a?(IO) and @ioerr.wait_writable(1) @ioerr.write "#{w_str}\n" @ioerr.flush unless @ioerr.sync - rescue Errno::EPIPE, Errno::EBADF, IOError + rescue Errno::EPIPE, Errno::EBADF, IOError, Errno::EINVAL + # 'Invalid argument' (Errno::EINVAL) may be raised by flush end end rescue ThreadError diff --git a/lib/puma/log_writer.rb b/lib/puma/log_writer.rb index 3953c95573..36de371d94 100644 --- a/lib/puma/log_writer.rb +++ b/lib/puma/log_writer.rb @@ -73,7 +73,8 @@ def internal_write(str) @stdout.is_a?(IO) and @stdout.wait_writable(1) @stdout.write w_str @stdout.flush unless @stdout.sync - rescue Errno::EPIPE, Errno::EBADF, IOError + rescue Errno::EPIPE, Errno::EBADF, IOError, Errno::EINVAL + # 'Invalid argument' (Errno::EINVAL) may be raised by flush end end rescue ThreadError