fix(integrations): Check retries_left before capturing exception#3803
Merged
sentrivana merged 3 commits intogetsentry:masterfrom Nov 19, 2024
malkovro:fix/rq-integration-ignore-retryable-exceptions
Merged
fix(integrations): Check retries_left before capturing exception#3803sentrivana merged 3 commits intogetsentry:masterfrom malkovro:fix/rq-integration-ignore-retryable-exceptions
sentrivana merged 3 commits intogetsentry:masterfrom
malkovro:fix/rq-integration-ignore-retryable-exceptions
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #3803 +/- ##
==========================================
+ Coverage 79.87% 79.90% +0.03%
==========================================
Files 137 137
Lines 15371 15373 +2
Branches 2608 2608
==========================================
+ Hits 12277 12284 +7
+ Misses 2223 2221 -2
+ Partials 871 868 -3
|
sentrivana
requested changes
Nov 19, 2024
Contributor
sentrivana
left a comment
There was a problem hiding this comment.
Looks like we need to make this compatible with older rq versions where the jobs don't have the retries_left attribute, see here: https://github.com/getsentry/sentry-python/actions/runs/11915419148/job/33205698444?pr=3803
Should hopefully be a small change, maybe we can use getattr and make sure if the property is not there, the behavior remains the same as before this change.
Bring back compatibility across rq versions Fixes GH-3707
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since rq/rq#1964 the job status is set to Failed before the handler decides whether to capture or not the exception while
handle_job_failurehas not yet been called so the job is not yet re-scheduled leading to all exceptions getting captured in RQ version >= 2.0.Related to #1076
Fixes #3707