Fix error reports not being sent on Sidekiq non-retries #1053
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There was a bug introduced on #761 which prevented errors on being reported from jobs that are running for the first time (not a retry).
Details
Some wrong assumptions were made on the behavior of retries on #761, mainly the following:
retry
would be set to a falsey value if the job is not a retry attempt. This is wrong.retry_count
can potentially be not present in a retry attempt.Here's a sample of a message hash for a job running first time with retries set:
While this is the message hash for a job that has been retried first time:
This commit aims to correct the bug introduced and allow failed jobs to report errors when they are running for the first time.