Repository navigation
Stop srcHttp temp sinks from accumulating on disk - #22
Merged
Merged
Conversation
sink => true left pulp-http-* files behind after each response, including failed requests. The path-backed File now removes the temp file it owns, and a caller-supplied sink path stays in place.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cloned File objects independently delete the same backing path, potentially invalidating still-live clones.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Prevents temporary HTTP sink files from accumulating by tying cleanup to path-backed File lifetimes.
Changes:
- Deletes ephemeral sinks after failures or file release.
- Preserves caller-managed sink paths.
- Adds lifecycle tests and documentation.
| File | Description |
|---|---|
packages/pulp/src/File.php |
Adds owned-path cleanup. |
packages/pulp/src/SrcHttpHandler.php |
Transfers or discards temporary sinks. |
packages/pulp/Pulp.php |
Documents sink lifecycle. |
packages/pulp/test/FileTest.php |
Tests release cleanup. |
packages/pulp/test/SrcHttpHandlerTest.php |
Tests sink success and failure behavior. |
packages/pulp/README.md |
Documents cleanup semantics. |
packages/pulp/CHANGELOG.md |
Records the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
split, shadow, and results clone path-backed files. A per-object unlink flag deleted the sink when the first clone was released.
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.

Summary
srcHttpwithsink => truewrote each response to apulp-http-*temp file and never deleted it. On a long-lived container that filled the writable layer (hundreds of GB of Mobilithek bodies).Filenow removes that temp file when it is released. A failed request deletes it immediately. A caller-supplied sink path is left in place, so the body still does not have to live as a PHP string while theFileis in use.Test plan
./vendor/bin/phpunit --testsuite pulp(62 tests)sink => truestill exposes a path-backedFileuntil it is released, and that an explicit sink path survives a non-success status