Skip to content

Conversation

@malkovro
Copy link
Contributor

@malkovro malkovro commented Nov 19, 2024

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_failure has 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

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

Thank you @malkovro!

@codecov
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.90%. Comparing base (01146bd) to head (81a7f71).
Report is 1 commits behind head on master.

✅ 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     
Files with missing lines Coverage Δ
sentry_sdk/integrations/rq.py 82.55% <100.00%> (+0.41%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

Awesome, ty!

@sentrivana sentrivana enabled auto-merge (squash) November 19, 2024 15:37
@sentrivana sentrivana merged commit 3e28853 into getsentry:master Nov 19, 2024
137 of 139 checks passed
@malkovro malkovro deleted the fix/rq-integration-ignore-retryable-exceptions branch November 19, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RQ 2.0 breaks a test

2 participants