Skip to content

Commit

Permalink
Allow retry of 500 API errors to be handled by restart policies
Browse files Browse the repository at this point in the history
  • Loading branch information
clinta committed Aug 22, 2017
1 parent 14452be commit 6b98ddf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (d *DockerDriver) Start(ctx *ExecContext, task *structs.Task) (*StartRespon
if err := d.startContainer(container); err != nil {
d.logger.Printf("[ERR] driver.docker: failed to start container %s: %s", container.ID, err)
pluginClient.Kill()
return nil, fmt.Errorf("Failed to start container %s: %s", container.ID, err)
return nil, structs.NewRecoverableError(fmt.Errorf("Failed to start container %s: %s", container.ID, err), structs.IsRecoverable(err))
}

// InspectContainer to get all of the container metadata as
Expand Down Expand Up @@ -1384,6 +1384,7 @@ START:
time.Sleep(1 * time.Second)
goto START
}
return structs.NewRecoverableError(startErr, true)
}

return recoverableErrTimeouts(startErr)
Expand Down

0 comments on commit 6b98ddf

Please sign in to comment.