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

report_after_job_retries option is ignored if sidekiq workers's retry is not specified #1698

Closed
viralpraxis opened this issue Jan 24, 2022 · 0 comments · Fixed by #1704
Closed
Milestone

Comments

@viralpraxis
Copy link

Environment

Sentry SaaS (sentry.io)
Sentry-sidekiq 5.0
Sidekiq 6.4.0

Steps to Reproduce

  1. Setup Sentry with sidekiq.report_after_job_retries set to true
  2. Create a Sidekiq worker which does not specify the per-worker retry option

Expected Result

According to Sidekiq documentation, if the retry is not specified, jobs will be retried 25 times. So if a job fails 25 times we expect sentry to report only the last one.

Actual Result

Senty reports every failed retry, ignoring the sidekiq.report_after_job_retries option.
However, setting retry option explicitly solves the issue.
Sidekiq's default retry value is true (boolean), while this code expects integer (sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb)

if Sentry.configuration.sidekiq.report_after_job_retries && retry_option.is_a?(Integer) && retry_option.positive?
  retry_count = context.dig(:job, "retry_count")
  if retry_count.nil? || retry_count < retry_option - 1
    return
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants