Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
containerd-shim-kata-v2: Use O_NONBLOCK for tty stdin.
Browse files Browse the repository at this point in the history
Fixes: #1659

our testing found that the client does not open
stdin with O_WRONLY, so the shim v2 was blocked forever
in open stdin with O_RDONLY. It's better to make it
opened with O_NONBLOCK, and do not block starting process
of container. and the containerd runc shim has done this
by bc1ff514 as well.

Signed-off-by: Yang, Wei <[email protected]>
Signed-off-by: Yang, Wei <[email protected]>
  • Loading branch information
Yang, Wei committed Jun 3, 2019
1 parent 3d8803b commit efc754f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion containerd-shim-v2/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newTtyIO(ctx context.Context, stdin, stdout, stderr string, console bool) (
var err error

if stdin != "" {
in, err = fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY, 0)
in, err = fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY|syscall.O_NONBLOCK, 0)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit efc754f

Please sign in to comment.