mirror of
https://github.com/status-im/consul.git
synced 2025-02-20 01:18:49 +00:00
Marking the state of a service as critical if the Docker Daemon doesn't respond while running checks
This commit is contained in:
parent
d695012e40
commit
40f72a8323
@ -597,19 +597,21 @@ func (c *CheckDocker) check() {
|
|||||||
exec = exec
|
exec = exec
|
||||||
} else {
|
} else {
|
||||||
c.Logger.Printf("[DEBUG] agent: Error while creating Exec: %s", err.Error())
|
c.Logger.Printf("[DEBUG] agent: Error while creating Exec: %s", err.Error())
|
||||||
|
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, fmt.Sprintf("Unable to create Exec, error: %s", err.Error()))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.dockerClient.StartExec(exec.ID, docker.StartExecOptions{Detach: false, Tty: false})
|
err = c.dockerClient.StartExec(exec.ID, docker.StartExecOptions{Detach: false, Tty: false})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Logger.Printf("[DEBUG] Error in executing health checks: %s", err.Error())
|
c.Logger.Printf("[DEBUG] Error in executing health checks: %s", err.Error())
|
||||||
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, err.Error())
|
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, fmt.Sprintf("Unable to start exec: %s", err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
execInfo, err := c.dockerClient.InspectExec(exec.ID)
|
execInfo, err := c.dockerClient.InspectExec(exec.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Logger.Printf("[DEBUG] Error in inspecting check result : %s", err.Error())
|
c.Logger.Printf("[DEBUG] Error in inspecting check result : %s", err.Error())
|
||||||
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, err.Error())
|
c.Notify.UpdateCheck(c.CheckID, structs.HealthCritical, fmt.Sprintf("Unable to inspect Exec: %s", err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user