fix(context): finish tar before closing export pipe - #7341
Open
tayfuryldz wants to merge 1 commit into
Open
tayfuryldz wants to merge 1 commit into
tayfuryldz wants to merge 1 commit into
Conversation
Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
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.
Fixes #7332.
Close the tar writer before closing the pipe used by context export. This lets archive/tar write the final file padding and end-of-archive records instead of attempting those writes after the pipe has already been closed.
The regression test uses TLS data with a non-block-aligned size and checks that the exported stream is block-aligned and ends with the two tar zero blocks.
I also reproduced the close-order behavior with the standard library in isolation: the old order produced a 513-byte truncated stream for a one-byte entry, while closing the tar writer first produced a complete 2048-byte stream.
The repository unit target cannot run directly in this checkout without its development container/dependency environment, so I have not represented it as a local pass.