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

Make sentry-sidekiq compatible with Sidekiq 7 #1930

Merged
merged 2 commits into from Nov 5, 2022
Merged

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented Nov 2, 2022

Most changes are for testing, but it also fixes an incompatible call in the ErrorHandler class.

@st0012 st0012 added this to the 5.6.0 milestone Nov 2, 2022
@st0012 st0012 added this to In progress in 5.x via automation Nov 2, 2022
@st0012 st0012 self-assigned this Nov 2, 2022
@st0012 st0012 force-pushed the test-against-sidekiq-7 branch 2 times, most recently from 6a966af to c1b1833 Compare November 2, 2022 13:38
@@ -40,7 +42,13 @@ def retry_limit(context)
when Integer
limit
when TrueClass
::Sidekiq.options[:max_retries] || 25
max_retries =
Copy link
Member

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?

Copy link
Collaborator Author

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]
Copy link
Member

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?

Copy link
Collaborator Author

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.

@st0012 st0012 marked this pull request as ready for review November 5, 2022 19:44
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for explaining!

@st0012 st0012 merged commit 6b35110 into master Nov 5, 2022
5.x automation moved this from In progress to Done Nov 5, 2022
@st0012 st0012 deleted the test-against-sidekiq-7 branch November 5, 2022 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5.x
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants