Repository navigation
exec: wait for I/O completion before return - #4392
Merged
Merged
Conversation
Signed-off-by: Swagat Bora <[email protected]>
Contributor
Author
|
@apostasie PTAL |
Contributor
|
LGTM. Failures are unrelated:
|
Contributor
|
cc @AkihiroSuda for maintainers review & merge. |
Contributor
|
@swagatbora90 this is obviously in the same vein as #4383 |
apostasie
approved these changes
Jul 1, 2025
This was referenced Jul 1, 2025
Contributor
Author
Yes, I can take a look. Thanks for the review. |
taylorsilva
added a commit
to concourse/concourse
that referenced
this pull request
Oct 26, 2026
We were still getting intermittent errors related to stdout not being captured from `get` and `put` steps. The error we'd get, which is one we return when stdout from a resource step is empty: ``` resource script (/opt/resource/out /tmp/build/put) output a null version ``` I took a look at the same lines from last time that call `Cancel()`, `Wait()`, `Close()` on the process's IO. I had previously debated the order of operations and if we even needed to call them. I _think_ we may have been introducing a race by calling `Cancel()` first. My thought is that IO copy operations would not finish because of our early `Cancel()` call. I've done a fresh round of research and found the following examples within the containerd ecosystem where the preference appears to be closing the process's IO with: `Wait()`, `Close()`. Don't call `Cancel()` at all. Main example I saw was from here: https://github.com/containerd/nerdctl/blob/127dce535ff237bebdeab638d272fcfb9813d744/pkg/cmd/container/exec.go#L150-L151 Which appears to be trying to fix the same issue as us: containerd/nerdctl#4392 They ended up making the same change here: https://github.com/containerd/nerdctl/pull/4383/changes This seems to be the preferred way to close the process IO for nerdctl. Let's try this because the current setup is definitely not working 100% of the time. It's annoying to have a job fail because we never captured the stdout I don't have any way of reproducing this, so this is a "hope and pray it works" commit. Other interesting thing to note: I made the previous change in this file in Feb 2025. nerdctl made their changes in June/July 2025. Seems like something in containerd probably introduced this flakey behaviour and we both tried working around it by manually interacting with the process IO. Signed-off-by: Taylor Silva <[email protected]>
taylorsilva
added a commit
to concourse/concourse
that referenced
this pull request
Oct 26, 2026
We were still getting intermittent errors related to stdout not being captured from `get` and `put` steps. The error we'd get, which is one we return when stdout from a resource step is empty: ``` resource script (/opt/resource/out /tmp/build/put) output a null version ``` I took a look at the same lines from last time that call `Cancel()`, `Wait()`, `Close()` on the process's IO. I had previously debated the order of operations and if we even needed to call them. I _think_ we may have been introducing a race by calling `Cancel()` first. My thought is that IO copy operations would not finish because of our early `Cancel()` call. I've done a fresh round of research and found the following examples within the containerd ecosystem where the preference appears to be closing the process's IO with: `Wait()`, `Close()`. Don't call `Cancel()` at all. Main example I saw was from here: https://github.com/containerd/nerdctl/blob/127dce535ff237bebdeab638d272fcfb9813d744/pkg/cmd/container/exec.go#L150-L151 Which appears to be trying to fix the same issue as us: containerd/nerdctl#4392 They ended up making the same change here: https://github.com/containerd/nerdctl/pull/4383/changes This seems to be the preferred way to close the process IO for nerdctl. Let's try this because the current setup is definitely not working 100% of the time. It's annoying to have a job fail because we never captured the stdout from the resource step. I don't have any way of reproducing this, so this is a "hope and pray it works" commit. Other interesting thing to note: I made the previous change in this file in Feb 2025. nerdctl made their changes in June/July 2025. Seems like something in containerd probably introduced this flakey behaviour and we both tried working around it by manually interacting with the process IO. Signed-off-by: Taylor Silva <[email protected]>
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 #4380