Skip to content

Commit

Permalink
Merge pull request #3073 from clinta/docker-500
Browse files Browse the repository at this point in the history
Allow retry of 500 API errors to be handled by restart policies
  • Loading branch information
dadgar committed Aug 24, 2017
2 parents 00c811a + 6b98ddf commit ba1eecb
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 @@ -643,7 +643,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 @@ -1350,6 +1350,7 @@ START:
time.Sleep(1 * time.Second)
goto START
}
return structs.NewRecoverableError(startErr, true)
}

return recoverableErrTimeouts(startErr)
Expand Down

0 comments on commit ba1eecb

Please sign in to comment.