(sentry-sidekiq): Fixed a deprecation warning in error handler#2160
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2160 +/- ##
==========================================
- Coverage 97.33% 97.30% -0.03%
==========================================
Files 97 97
Lines 3638 3638
==========================================
- Hits 3541 3540 -1
- Misses 97 98 +1
|
| # defaults to Sidekiq's default configuration `Sidekiq.default_configuration` | ||
| # Sidekiq will pass the config in starting Sidekiq 7.1.5, see | ||
| # https://github.com/sidekiq/sidekiq/pull/6051 | ||
| def call(ex, context, sidekiq_config = ::Sidekiq.default_configuration) |
There was a problem hiding this comment.
I think ::Sidekiq.default_configuration was introduced in 7.0 so this will break older Sidekiq versions. Also, we need to update retry_limit to use the passed sidekiq_config if its present.
There was a problem hiding this comment.
Hmmm. You're right — I think then we could set it to nil by default, but if it's present and has retry_limit, use that. I'll fix this up.
There was a problem hiding this comment.
Thank you again for pointing this out, and for the deferred cleanup of the env var. I think I got to it, not sure if my code is the most elegant.
|
@st0012 that one should be good to go now, I think. |
56ea1db to
cc60849
Compare
To avoid a deprecation warning from sidekiq relative to exception handling, we need getsentry/sentry-ruby#2160 not yet released
|
@sl0thentr0py When will this be released? |
|
@rafaelsales this was already released in https://github.com/getsentry/sentry-ruby/releases/tag/5.14.0 |
Summary
This PR fixes the deprecation warning that occurs when using Sidekiq >= 7.1.5: #2157. Closes #2157.
Changes
I'm just getting started, so I documented some steps as I was onboarding:
CONTRIBUTING.md, and bumped Rails version there.sentry-sidekiqGemfile.Next steps
We could in theory use some of those configuration values to enrich the reported errors: https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/config.rb, but, they are not specific to the error at hand.