Skip to content

Commit

Permalink
Merge pull request #268 from riemann/handle-socket-errors
Browse files Browse the repository at this point in the history
Gracefully handle all communication errors
  • Loading branch information
jamtur01 authored May 22, 2023
2 parents bc936ce + 36d96f9 commit fbe7053
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/riemann/tools/riemann_client_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ def initialize(options)
events << @queue.pop while !@queue.empty? && events.size < @max_bulk_size

client.bulk_send(events)
rescue Riemann::Client::Error => e
warn "Dropping #{events.size} event#{'s' if events.size > 1} due to #{e}"
rescue StandardError => e
warn "#{e.class} #{e}\n#{e.backtrace.join "\n"}"
Thread.main.terminate
warn "Dropping #{events.size} event#{'s' if events.size > 1} due to #{e}"
end
end

Expand Down

0 comments on commit fbe7053

Please sign in to comment.