storage: wait for tar-split completion to avoid reader race#801
Open
jankaluza wants to merge 1 commit intocontainers:mainfrom
Open
storage: wait for tar-split completion to avoid reader race#801jankaluza wants to merge 1 commit intocontainers:mainfrom
jankaluza wants to merge 1 commit intocontainers:mainfrom
Conversation
|
Packit jobs failed. @containers/packit-build please check. |
cc2e066 to
ccf4fb2
Compare
giuseppe
approved these changes
Apr 29, 2026
Member
giuseppe
left a comment
There was a problem hiding this comment.
LGTM
restarted the failed test, the failure seems unrelated
Member
Author
|
Podman and Buildah tests with the PR applied: |
6 tasks
Member
Author
|
@mtrmac , your review would be appreciated, since you know the context of this change and you also reviewed the tar-split part of this change. |
mtrmac
reviewed
Apr 29, 2026
1 task
Switch to `NewInputTarStreamWithDone` and explicitly wait for the tar-split goroutine to finish before returning. This prevents races with `uncompressed.Close()` while tar-split is still reading. Fixes: containers#148 Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
mtrmac
reviewed
Apr 30, 2026
| _, err = io.Copy(io.Discard, tsReader) | ||
| require.NoError(t, err) | ||
| require.NoError(t, <-done) | ||
| require.NoError(t, tsReader.Close()) |
Contributor
There was a problem hiding this comment.
I think the generally correct order is close (to definitely abort the goroutine), <-done (to wait for it). Also in the other test.
Member
|
LGTM |
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.
Switch to
NewInputTarStreamWithDoneand explicitly wait for the tar-split goroutine to finish before returning.This prevents races with
uncompressed.Close()while tar-split is still reading.Fixes: #148