fix(api): delegate concurrent deletion deadlocks to TaskBackoffError#6995
fix(api): delegate concurrent deletion deadlocks to TaskBackoffError#6995SahilJat wants to merge 2 commits intoFlagsmith:mainfrom
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
@SahilJat is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (71.42%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6995 +/- ##
==========================================
- Coverage 98.31% 98.23% -0.09%
==========================================
Files 1335 1335
Lines 49784 49669 -115
==========================================
- Hits 48947 48793 -154
- Misses 837 876 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #6878
Please describe.
1.Wrapped the deletion queries in
environments/tasks.pyandfeatures/tasks.pywith specific exception handlers forOperationalError,IntegrityError, andTransactionManagementError.2. Delegated the retry mechanism by raising
TaskBackoffError.3. This allows the first worker to hold the lock and complete its softdelete cascade, while the colliding worker gracefully yields, backs off, and safely retries without polluting Sentry with unhandled DB exceptions.
How did you test this code?
Please describe.