Skip to content

report_after_job_retries does not report errors for jobs with 0 retries #1556

@TAGraves

Description

@TAGraves

Describe the bug
I was excited to see the report_after_job_retries feature get released in sentry-sidekiq this morning. Unfortunately we have many jobs configured with sidekiq_options retry: 0 and failures in these jobs do not appear to be sent to Sentry. Thankfully the fix looks pretty simple so I will open a PR with an attempt at fixing it.

To Reproduce
Set config.sidekiq.report_after_job_retries = true and then configure a job that will fail with sidekiq_options retry: 0. Enqueue that job and observe that it ends up in the Sidekiq dead queue and does not report the error to Sentry.

Expected behavior
The error should be reported to Sentry.

Actual behavior
The error is not reported to Sentry.

Environment

  • Ruby Version: 3.0.2
  • SDK Version: 4.7
  • Integration Versions (if any): Sidekiq 6.2.2

Sentry Config

Sentry.init do |config|
  config.sidekiq.report_after_job_retries = true
end

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions