Raise proper Pulp errors from failing tasks - #8096
Open
dark3rMatt3r wants to merge 1 commit into
Open
dark3rMatt3r wants to merge 1 commit into
dark3rMatt3r wants to merge 1 commit into
Conversation
Raw non-Pulp exceptions escaping the task runner triggered pulpcore.deprecation warnings and would lose their messages under REDACT_UNSAFE_EXCEPTIONS in 3.130. Replication, the generic delete tasks, and the failing test tasks now raise PulpException subclasses (ReplicateError, ExternalServiceError, the new ProtectedResourceError, and PulpTestError). Assisted-by: claude-opus-4.8
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.
Problem
Raw, non-Pulp exceptions escaping the task runner (
_execute_task) log apulpcore.deprecation"will be sanitized" warning and would lose their messages underREDACT_UNSAFE_EXCEPTIONSin 3.130. Because thedeprecationsCI job asserts that log is empty, these leaks turn every PR's run red. This is the general form of the (already-closed) #7910.Offending paths and fixes — each now raises a
PulpExceptionsubclass:finalize_replicationraised a bareException; now raisesReplicateError, extended with an optionaldetailsarg to keep the failed-subtask summary (backward compatible).requestsHTTPErrors escape when contacting the upstream (e.g. the 404 schema fetch); these are now wrapped inExternalServiceError, matching the existing SSL handling.general_delete/general_multi_delete/ageneral_delete) let DjangoProtectedErrorescape; they now raise the newProtectedResourceError(PLP0029), extending theDoesNotExisthandling from Update delete task to skip over already deleted objects #7930.failing_task/afailing_tasktest tasks raisedRuntimeError; they now raise aPulpExceptionsubclass so their messages survive redaction. The task-purge fixture uses that task instead ofsleep(-1).ProtectedResourceErroris exported frompulpcore.exceptionsand thepulpcore.plugin.exceptionsplugin API.Testing
pulpcore/tests/unit/tasking/test_delete_tasks.py) cover theProtectedError→ProtectedResourceErrorconversion for all three delete tasks.Notes
replica.pynow importsrequests(present transitively via pulp-glue) — happy to add it topyproject.tomlif preferred.Root-cause writeup: dark3rMatt3r#1
📜 Checklist
See: Pull Request Walkthrough
🤖 Generated with Claude Code