-
-
Notifications
You must be signed in to change notification settings - Fork 528
Resolve #2860 - Do not ignore Job class sidekiq options while assessing retryable job #2861
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,9 @@ def call(ex, context, sidekiq_config = nil) | |
|
|
||
| def retryable?(context) | ||
| retry_option = context.dig(:job, "retry") | ||
| retry_option ||= context.dig(:job, "class")&.safe_constantize | ||
| &.get_sidekiq_options | ||
| &.[]("retry") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ||= overrides explicit retry:false from job hashHigh Severity Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. retry_limit returns 0 for class-option-only retryable jobsMedium Severity When Additional Locations (1) |
||
| # when `retry` is not specified, it's default is `true` and it means 25 retries. | ||
| retry_option == true || (retry_option.is_a?(Integer) && retry_option.positive?) | ||
| end | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The use of
||=inretryable?causes a job-levelretry: falsesetting to be incorrectly overridden by the class-level retry option, potentially suppressing Sentry error reports.Severity: HIGH
Suggested Fix
Replace the
||=operator with an explicitif retry_option.nil?check. This ensures that afalsevalue for theretryoption from the job payload is respected and not overridden by the class-level configuration.Prompt for AI Agent