Repository navigation
filesystem: cancel PutContent writer on commit failure - #5102
Merged
milosgajdos merged 1 commit intoNov 27, 2026
Merged
Conversation
Member
|
@perfloop-agent can you squash |
tsenart
force-pushed
the
perfloop-pr-open-rnme8xnp16
branch
from
November 26, 2026 20:52
0afd3e0 to
df591bc
Compare
|
@milosgajdos squashed into one commit, with the same code as before. The CI runs are now waiting for a maintainer to approve them, because I pushed the squash from my account. Could you approve them? |
Buffered writes may fail for the first time during Commit. Cancel the writer before returning a commit error so its temporary file is closed and removed, and join any cleanup error with the original failure. Force a buffered PutContent write to exceed RLIMIT_FSIZE during Commit. Check that no temporary file remains and that a previous destination is left intact. Run the limit-bound checks in a child process so the limit cannot affect other tests or the Go test log. Signed-off-by: Perfloop Agent <[email protected]>
perfloop-agent
force-pushed
the
perfloop-pr-open-rnme8xnp16
branch
from
November 26, 2026 22:13
df591bc to
5a32308
Compare
milosgajdos
approved these changes
Nov 27, 2026
This was referenced Nov 29, 2026
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.
Since #4624, a filesystem-backed registry can leave orphaned temporary files when
PutContentfails inCommit, including when a buffered write exceeds a file-size limit. The operation returns an error, but its temporary file stays in the live storage tree. Cancel the writer before returning so the uncommitted file is closed and removed.cc @milosgajdos
For example, a 128-byte value fits in the default 4 KiB buffer. With a 64-byte file-size limit, copying succeeds in memory and flushing fails in
Commit. Previously that leftstartedat.<uuid>.tmp; now the directory is empty, or holds only the unchanged destination when replacing a file.errors.Joinretains the commit error and reports any cancellation error. Successful commits, renames, and directory syncing are unchanged.The Linux regression in
registry/storage/driver/filesystem/driver_linux_test.goapplies the limit in a child process so it cannot affect other tests. Go tests pass for commit-failure cleanup, content replacement, and failed-rename cleanup.File removal can still fail; in that case both errors are returned.
AI assisted with this change.
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.