Merge pull request #36100 from timstclair/cris-leak
Automatic merge from submit-queue Cleanup leaking goroutine Cleanup potential go-routine leak in ExecSync path by removing timeout support. Timeout support is added in https://github.com/kubernetes/kubernetes/pull/33366 and https://github.com/kubernetes/kubernetes/pull/35893, and until those merge this is consistent with current behavior. /cc @rhcarvalho
This commit is contained in:
@@ -49,23 +49,8 @@ func (r *streamingRuntime) exec(containerID string, cmd []string, in io.Reader,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(timstclair): Clean this up once PR#33366 merges.
|
// TODO(timstclair): Add timeout once PR#33366 merges.
|
||||||
if timeout <= 0 {
|
return r.execHandler.ExecInContainer(r.client, container, cmd, in, out, errw, tty, resize)
|
||||||
// Run until command exits.
|
|
||||||
return r.execHandler.ExecInContainer(r.client, container, cmd, in, out, errw, tty, resize)
|
|
||||||
}
|
|
||||||
|
|
||||||
errCh := make(chan error)
|
|
||||||
go func() {
|
|
||||||
errCh <- r.execHandler.ExecInContainer(r.client, container, cmd, in, out, errw, tty, resize)
|
|
||||||
}()
|
|
||||||
|
|
||||||
select {
|
|
||||||
case err := <-errCh:
|
|
||||||
return err
|
|
||||||
case <-time.After(timeout):
|
|
||||||
return streaming.ErrorTimeout("exec", timeout)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *streamingRuntime) Attach(containerID string, in io.Reader, out, errw io.WriteCloser, resize <-chan term.Size) error {
|
func (r *streamingRuntime) Attach(containerID string, in io.Reader, out, errw io.WriteCloser, resize <-chan term.Size) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user