mirror of https://github.com/docker/docs.git
Enforce minimum backoff to avoid simultaneous validation on one engine.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
8f31d014e4
commit
14bfc52d36
|
@ -239,7 +239,9 @@ func (e *Engine) TimeToValidate() bool {
|
||||||
}
|
}
|
||||||
sinceLastUpdate := time.Since(e.updatedAt)
|
sinceLastUpdate := time.Since(e.updatedAt)
|
||||||
// Increase check interval for a pending engine according to failureCount and cap it at a limit
|
// Increase check interval for a pending engine according to failureCount and cap it at a limit
|
||||||
if sinceLastUpdate > validationLimit || sinceLastUpdate > time.Duration(e.failureCount)*failureBackoff {
|
// '+1' would enforce a minimum backoff because e.failureCount could be 0 at first join, or
|
||||||
|
// the engine has a duplicate ID
|
||||||
|
if sinceLastUpdate > validationLimit || sinceLastUpdate > time.Duration(e.failureCount+1)*failureBackoff {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue