diff options
Diffstat (limited to 'pkg/proc/exec.go')
-rw-r--r-- | pkg/proc/exec.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/proc/exec.go b/pkg/proc/exec.go index f52e1afdd..9b729e917 100644 --- a/pkg/proc/exec.go +++ b/pkg/proc/exec.go @@ -191,6 +191,12 @@ func (e *execProcess) start(ctx context.Context) (err error) { e.stdin = sc } var copyWaitGroup sync.WaitGroup + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer func() { + if err != nil { + cancel() + } + }() if socket != nil { console, err := socket.ReceiveMaster() if err != nil { |