Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLSServer: Fix crash on logging errors #3483

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/fluent/plugin_helper/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -709,13 +709,15 @@ def try_tls_accept
return true
end
rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
peeraddr = (@_handler_socket.peeraddr rescue PEERADDR_FAILED)
@log.trace "unexpected error before accepting TLS connection",
ashie marked this conversation as resolved.
Show resolved Hide resolved
host: @_handler_socket.peeraddr[3], port: @_handler_socket.peeraddr[1], error: e
addr: peeraddr[3], host: peeraddr[2], port: peeraddr[1], error: e
close rescue nil
rescue OpenSSL::SSL::SSLError => e
peeraddr = (@_handler_socket.peeraddr rescue PEERADDR_FAILED)
# Use same log level as on_readable
@log.warn "unexpected error before accepting TLS connection by OpenSSL",
host: @_handler_socket.peeraddr[3], port: @_handler_socket.peeraddr[1], error: e
addr: peeraddr[3], host: peeraddr[2], port: peeraddr[1], error: e
close rescue nil
end

Expand Down