ENG-3925: Write execution log when stuck task reaper errors a privacy request#8253
Open
eastandwestwind wants to merge 5 commits into
Open
ENG-3925: Write execution log when stuck task reaper errors a privacy request#8253eastandwestwind wants to merge 5 commits into
eastandwestwind wants to merge 5 commits into
Conversation
_cancel_interrupted_tasks_and_error_privacy_request called error_processing() but never created an execution log, so the error message was only in server logs — invisible in the Admin UI. Now writes an error execution log before marking the request as errored. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8253 +/- ##
=======================================
Coverage 85.15% 85.15%
=======================================
Files 670 670
Lines 43497 43501 +4
Branches 5093 5093
=======================================
+ Hits 37039 37043 +4
+ Misses 5351 5350 -1
- Partials 1107 1108 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cover the except branches for execution log write failure, error_processing failure, and cancel_celery_tasks call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Ticket https://ethyca.atlassian.net/browse/ENG-3928
Description Of Changes
When a privacy request task dies at the worker level (OOM kill, crash, etc.), the request stays in
in_processinguntil the stuck task reaper finds it. The reaper calls_cancel_interrupted_tasks_and_error_privacy_requestwhich sets the status toerror— but it never created an execution log. The error message (e.g., "stuck without a running task") was only written to server logs vialogger.error(), invisible in the Admin UI.This adds an
add_error_execution_log()call so the reaper's error message is visible in the request's Activity tab, giving operators immediate visibility into why a request failed.Code Changes
src/fides/api/service/privacy_request/request_service.py— Addedadd_error_execution_log()call in_cancel_interrupted_tasks_and_error_privacy_requestbeforeerror_processing(), with try/except to handle DB write failures gracefullytests/fides/task/test_requeue_interrupted_tasks.py— 5 new tests:Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdated