@@ -147,7 +147,10 @@ func (e *execProcess) start(ctx context.Context) (err error) {
147147 return e .parent .runtimeError (err , "OCI runtime exec failed" )
148148 }
149149 if e .stdio .Stdin != "" {
150- sc , err := fifo .OpenFifo (ctx , e .stdio .Stdin , syscall .O_WRONLY | syscall .O_NONBLOCK , 0 )
150+ fifoCtx , cancel := context .WithTimeout (ctx , 15 * time .Second )
151+ defer cancel ()
152+
153+ sc , err := fifo .OpenFifo (fifoCtx , e .stdio .Stdin , syscall .O_WRONLY | syscall .O_NONBLOCK , 0 )
151154 if err != nil {
152155 return errors .Wrapf (err , "failed to open stdin fifo %s" , e .stdio .Stdin )
153156 }
@@ -164,7 +167,10 @@ func (e *execProcess) start(ctx context.Context) (err error) {
164167 return errors .Wrap (err , "failed to start console copy" )
165168 }
166169 } else if ! e .stdio .IsNull () {
167- if err := copyPipes (ctx , e .io , e .stdio .Stdin , e .stdio .Stdout , e .stdio .Stderr , & e .wg , & copyWaitGroup ); err != nil {
170+ fifoCtx , cancel := context .WithTimeout (ctx , 15 * time .Second )
171+ defer cancel ()
172+
173+ if err := copyPipes (fifoCtx , e .io , e .stdio .Stdin , e .stdio .Stdout , e .stdio .Stderr , & e .wg , & copyWaitGroup ); err != nil {
168174 return errors .Wrap (err , "failed to start io pipe copy" )
169175 }
170176 }
0 commit comments