Skip to content

Make sentry-sidekiq compatible with Sidekiq 7#1930

Merged
st0012 merged 2 commits intomasterfrom
test-against-sidekiq-7
Nov 5, 2022
Merged

Make sentry-sidekiq compatible with Sidekiq 7#1930
st0012 merged 2 commits intomasterfrom
test-against-sidekiq-7

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@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 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
@st0012 st0012 force-pushed the test-against-sidekiq-7 branch from 7fcd273 to d49840c Compare November 2, 2022 13:45
@st0012 st0012 requested a review from sl0thentr0py November 2, 2022 13:45
limit
when TrueClass
::Sidekiq.options[:max_retries] || 25
max_retries =
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
@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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants