-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Make sentry-sidekiq
compatible with Sidekiq 7
#1930
Conversation
6a966af
to
c1b1833
Compare
7fcd273
to
d49840c
Compare
@@ -40,7 +42,13 @@ def retry_limit(context) | |||
when Integer | |||
limit | |||
when TrueClass | |||
::Sidekiq.options[:max_retries] || 25 | |||
max_retries = |
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.
I haven't looked at this before, but why does sentry have to deal with the retry logic at all?
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.
Because with config.sidekiq.report_after_job_retries = true
, the SDK should wait for the retry quota exhausted before reporting.
::Sidekiq.options[:max_retries] || 25 | ||
max_retries = | ||
if WITH_SIDEKIQ_7 | ||
::Sidekiq.default_configuration[:max_retries] |
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.
is default_configuration
the right thing if the user overrides max_retries
?
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.
From the only invocation of max_retries
, I think users need to either assign the default_configuration
value, or configure it at job level (which is handled in the Integer
case).
So yeah, in this condition default_configuration
is the right place to check.
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.
thx for explaining!
Most changes are for testing, but it also fixes an incompatible call in the
ErrorHandler
class.