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

tty: close epollConsole on errors #1895

Merged
merged 1 commit into from Sep 20, 2018

Conversation

Projects
None yet
5 participants
@giuseppe
Contributor

giuseppe commented Sep 20, 2018

make sure epollConsole is closed before returning an error. It solves
a hang when using these commands with a container that uses a
terminal:

runc run foo &
ssh root@localhost runc exec foo echo hello

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

tty: close epollConsole on errors
make sure epollConsole is closed before returning an error.  It solves
a hang when using these commands with a container that uses a
terminal:

runc run foo &
ssh root@localhost runc exec foo echo hello

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@rhatdan

This comment has been minimized.

Show comment
Hide comment
@rhatdan

rhatdan Sep 20, 2018

Contributor

LGTM

Contributor

rhatdan commented Sep 20, 2018

LGTM

@crosbymichael

This comment has been minimized.

Show comment
Hide comment
@crosbymichael
Member

crosbymichael commented Sep 20, 2018

LGTM

Approved with PullApprove

@rhatdan

This comment has been minimized.

Show comment
Hide comment
Contributor

rhatdan commented Sep 20, 2018

@mrunalp

This comment has been minimized.

Show comment
Hide comment
@mrunalp

mrunalp Sep 20, 2018

Contributor

LGTM

Approved with PullApprove

Contributor

mrunalp commented Sep 20, 2018

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit 00dc700 into opencontainers:master Sep 20, 2018

2 checks passed

code-review/pullapprove Approved by crosbymichael, mrunalp
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@@ -97,9 +97,11 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
// set raw mode to stdin and also handle interrupt
stdin, err := console.ConsoleFromFile(os.Stdin)
if err != nil {
epollConsole.Close()

This comment has been minimized.

@cyphar

cyphar Sep 21, 2018

Member

I think this should've been done with the defer-named-return trick. I'll submit a PR for it.

@cyphar

cyphar Sep 21, 2018

Member

I think this should've been done with the defer-named-return trick. I'll submit a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment