Allow retry of 500 API errors to be handled by restart policies

This commit is contained in:
Clint Armstrong 2017-08-22 09:03:31 -04:00
parent a26b80f382
commit ae230395ba
1 changed files with 2 additions and 1 deletions

View File

@ -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
@ -1384,6 +1384,7 @@ START:
time.Sleep(1 * time.Second)
goto START
}
return structs.NewRecoverableError(startErr, true)
}
return recoverableErrTimeouts(startErr)