Repository navigation
Conversation
namest504
force-pushed
the
multipart-tempfile-cleanup
branch
from
October 22, 2026 00:03
c31e73c to
649bf19
Compare
bclozel
force-pushed
the
multipart-tempfile-cleanup
branch
from
October 22, 2026 08:15
649bf19 to
d86e9fc
Compare
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.
When a part exceeds
maxInMemorySize,PartGenerator.InMemoryState.switchToFile()creates the temporary file and theFileStatefirst and only then replays the buffered content into it. If that content already exceedsmaxDiskUsagePerPart,FileState.onBody()throws the limit exception before the new state is installed, so the cleanup inPartGenerator.onBody()only disposes the in-memory state and the temporary file is left behind in the storage directory. This happens whenevermaxDiskUsagePerPart < maxInMemorySize + bufferSize; the existing test for gh-37238 leaves such a file injava.io.tmpdiras well.This change checks the disk usage limit before creating the file, consistent with the reactive
PartGenerator(gh-37285), and releases the current buffer as required byPartListener.onBody(). The added test drivesPartGeneratorwith a@TempDirand asserts that no file remains.