Skip to content

Commit

Permalink
Merge pull request #6144 from hashicorp/b-docker-exec
Browse files Browse the repository at this point in the history
docker: Fix issue where an exec may never timeout
  • Loading branch information
endocrimes committed Aug 16, 2019
2 parents 478195a + a921c21 commit 83a75b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/docker/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 83a75b3

Please sign in to comment.