Skip to content

Commit

Permalink
do not crash coverage writer on errors, loop back off instead
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Apr 29, 2024
1 parent 74c9750 commit 2bea9f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/datadog/ci/itr/coverage/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ def write(event)
def perform(*events)
responses = transport.send_events(events)

loop_back_off! if responses.find(&:server_error?)
if responses.find(&:server_error?)
loop_back_off!
Datadog.logger.warn { "Encountered server error while sending coverage events" }
end

nil
rescue => e
Datadog.logger.warn { "Error while sending coverage events: #{e}" }
loop_back_off!
end

def stop(force_stop = false, timeout = @shutdown_timeout)
Expand Down

0 comments on commit 2bea9f7

Please sign in to comment.