Merge pull request #6144 from hashicorp/b-docker-exec
docker: Fix issue where an exec may never timeout
This commit is contained in:
commit
e943ef3ac6
|
@ -1323,7 +1323,7 @@ func (d *Driver) ExecTaskStreaming(ctx context.Context, taskID string, opts *dri
|
|||
const execTerminatingTimeout = 3 * time.Second
|
||||
start := time.Now()
|
||||
var res *docker.ExecInspect
|
||||
for res == nil || res.Running || time.Since(start) > execTerminatingTimeout {
|
||||
for (res == nil || res.Running) && time.Since(start) <= execTerminatingTimeout {
|
||||
res, err = client.InspectExec(exec.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to inspect exec result: %v", err)
|
||||
|
|
Loading…
Reference in a new issue