mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Make container exist errors non-retriable
This change makes it so that the task runner does not retry container exists errors and also a sleep is added on the local retry.
This commit is contained in:
@@ -949,8 +949,7 @@ func (d *DockerDriver) createContainer(config docker.CreateContainerOptions) (*d
|
||||
recoverable := func(err error) *structs.RecoverableError {
|
||||
r := false
|
||||
if strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting headers") ||
|
||||
strings.Contains(err.Error(), "EOF") ||
|
||||
strings.Contains(err.Error(), "container already exists") {
|
||||
strings.Contains(err.Error(), "EOF") {
|
||||
r = true
|
||||
}
|
||||
return structs.NewRecoverableError(err, r)
|
||||
@@ -997,6 +996,7 @@ CREATE:
|
||||
|
||||
if attempted < 5 {
|
||||
attempted++
|
||||
time.Sleep(1 * time.Second)
|
||||
goto CREATE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,3 +29,9 @@ client {
|
||||
ports {
|
||||
http = 5656
|
||||
}
|
||||
|
||||
advertise {
|
||||
http = "localhost"
|
||||
rpc = "localhost"
|
||||
serf = "localhost"
|
||||
}
|
||||
|
||||
@@ -23,3 +23,9 @@ client {
|
||||
ports {
|
||||
http = 5657
|
||||
}
|
||||
|
||||
advertise {
|
||||
http = "localhost"
|
||||
rpc = "localhost"
|
||||
serf = "localhost"
|
||||
}
|
||||
|
||||
@@ -11,3 +11,9 @@ server {
|
||||
# Self-elect, should be 3 or 5 for production
|
||||
bootstrap_expect = 1
|
||||
}
|
||||
|
||||
advertise {
|
||||
http = "localhost"
|
||||
rpc = "localhost"
|
||||
serf = "localhost"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user