diff --git a/runtime/v1/linux/proc/exec.go b/runtime/v1/linux/proc/exec.go index 4a3fefddc..9e5261adb 100644 --- a/runtime/v1/linux/proc/exec.go +++ b/runtime/v1/linux/proc/exec.go @@ -164,10 +164,7 @@ func (e *execProcess) start(ctx context.Context) (err error) { return e.parent.runtimeError(err, "OCI runtime exec failed") } if e.stdio.Stdin != "" { - fifoCtx, cancel := context.WithTimeout(ctx, 15*time.Second) - defer cancel() - - sc, err := fifo.OpenFifo(fifoCtx, e.stdio.Stdin, syscall.O_WRONLY|syscall.O_NONBLOCK, 0) + sc, err := fifo.OpenFifo(ctx, e.stdio.Stdin, syscall.O_WRONLY|syscall.O_NONBLOCK, 0) if err != nil { return errors.Wrapf(err, "failed to open stdin fifo %s", e.stdio.Stdin) } @@ -184,10 +181,7 @@ func (e *execProcess) start(ctx context.Context) (err error) { return errors.Wrap(err, "failed to start console copy") } } else if !e.stdio.IsNull() { - fifoCtx, cancel := context.WithTimeout(ctx, 15*time.Second) - defer cancel() - - if err := copyPipes(fifoCtx, e.io, e.stdio.Stdin, e.stdio.Stdout, e.stdio.Stderr, &e.wg, ©WaitGroup); err != nil { + if err := copyPipes(ctx, e.io, e.stdio.Stdin, e.stdio.Stdout, e.stdio.Stderr, &e.wg, ©WaitGroup); err != nil { return errors.Wrap(err, "failed to start io pipe copy") } } diff --git a/runtime/v1/linux/proc/io.go b/runtime/v1/linux/proc/io.go index 96b759cf9..c9b7145c8 100644 --- a/runtime/v1/linux/proc/io.go +++ b/runtime/v1/linux/proc/io.go @@ -112,7 +112,7 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w rio.Stdin().Close() return nil } - f, err := fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY, 0) + f, err := fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY|syscall.O_NONBLOCK, 0) if err != nil { return fmt.Errorf("containerd-shim: opening %s failed: %s", stdin, err) } diff --git a/runtime/v2/runc/service.go b/runtime/v2/runc/service.go index 625c44434..55dbeb069 100644 --- a/runtime/v2/runc/service.go +++ b/runtime/v2/runc/service.go @@ -98,8 +98,7 @@ type service struct { ec chan runcC.Exit ep *epoller - id string - // Filled by Create() + id string bundle string cg cgroups.Cgroup } diff --git a/runtime/v2/runc/service_linux.go b/runtime/v2/runc/service_linux.go index 4d7ceb574..5e30cfcb3 100644 --- a/runtime/v2/runc/service_linux.go +++ b/runtime/v2/runc/service_linux.go @@ -42,7 +42,7 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console } 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 }