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

Switch to bufio Reader for exec streams #4400

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

haircommander
Copy link
Collaborator

There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened.
Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences.
Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container.

Note: I think there are some missed edge cases that need hammering out, so I would say this is WIP until I know everything works as expected

fixes: #4397
fixes: #4326
fixes the open part of: #3302

Signed-off-by: Peter Hunt pehunt@redhat.com

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 2019
@mheon
Copy link
Member

mheon commented Oct 31, 2019

Neat. Does this solve our pipe issues?

@haircommander
Copy link
Collaborator Author

"solve" as in the unix pipe issue disappears. It still doesn't really work as expected, or work like run does (echo hi | podman exec -til echo returns nothing) but the error disappears :D I think this is a good step to making pipes actually work

@mheon
Copy link
Member

mheon commented Oct 31, 2019

I think the way run does it might also be broken, though, so this could well be more correct than run.

There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened.
Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences.
Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Oct 31, 2019

@haircommander Seems to pass the tests.
LGTM
@vrothberg @giuseppe @baude PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM, can we remove the WIP?

@haircommander haircommander changed the title WIP: Switch to bufio Reader for exec streams Switch to bufio Reader for exec streams Nov 1, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 1, 2019
@haircommander
Copy link
Collaborator Author

Sure, i think there's still work to be done but we're on the right track

@rhatdan
Copy link
Member

rhatdan commented Nov 1, 2019

/lgtm
/approve
Nice work @haircommander

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2019
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2019
@openshift-merge-robot openshift-merge-robot merged commit 69165fa into containers:master Nov 1, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocked keyboard input after entering a container podman exec stdin regression
6 participants