Fix temp file leak in pull-through metadata streaming. - #7933
Draft
aKlimau wants to merge 1 commit into
Draft
Conversation
mdellweg
reviewed
Jul 29, 2026
| await response.write(data) | ||
| if remote.policy != Remote.STREAMED: | ||
| if save_artifact and remote.policy != Remote.STREAMED: | ||
| await original_handle_data(data) |
Member
There was a problem hiding this comment.
This is where the downloader saves the file to disk?
At the very least this change looks reasonable to me.
Member
There was a problem hiding this comment.
It looks like there are several places where we check for exactly save_artifact and remote.policy != Remote.STREAMED can we redefine the variable so that it already contains the streamed condition?
(Somehow this may be a copy-and-paste / missed-all-the-places-to-update bug coming from exactly there.)
Contributor
Author
There was a problem hiding this comment.
This is where the downloader saves the file to disk?
Yes, original_handle_data that usually points to BasedDownloader handle_data that does the writing (if not overriden by plugins downloader)
aKlimau
force-pushed
the
pull-through-leak
branch
2 times, most recently
from
July 29, 2026 10:23
bde34c6 to
2ab7b43
Compare
aKlimau
force-pushed
the
pull-through-leak
branch
from
July 29, 2026 13:16
2ab7b43 to
1011edc
Compare
dralley
marked this pull request as draft
July 29, 2026 16:32
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.
Currently there is a problem with non content type files staying indefinitely on the disk when using _stream_remote_artifact() even if save_artifact flag is set to false.
I don't see a good reason for writing this data on disk in the first place, this pr fixes that.
fixes: #7846
📜 Checklist
See: Pull Request Walkthrough