Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stop after EOF error condition #1654

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/client/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (c *ConmonClient) redirectResponseToOutputStreams(
return nil
}
}
if er == io.EOF || (cfg.ContainerStdin && !cfg.StopAfterStdinEOF) {
if er == io.EOF && cfg.ContainerStdin && !cfg.StopAfterStdinEOF {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, we have to test if this works with CRI-O, I know we had some issues with that in the past.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more I think about it, it probably should just be

if er == io.EOF {
    return nil
}

Copy link
Member

@saschagrunert saschagrunert Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cfg.ContainerStdin && !cfg.StopAfterStdinEOF feels like a workaround, is that related to #1655?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely we need to detect the EOF and then drain the streams.

return nil
}
if errors.Is(er, syscall.ECONNRESET) {
Expand Down