Skip to content

Commit

Permalink
Loggers - internal_write - catch Errno::EINVAL (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Mar 28, 2023
1 parent 68f62d5 commit 38d657d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/puma/error_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/puma/log_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38d657d

Please sign in to comment.