mirror of https://github.com/docker/docs.git
Merge pull request #1658 from dongluochen/raceValidation
Fix a race condition in pending engine validation
This commit is contained in:
commit
8f31d014e4
|
@ -271,6 +271,11 @@ func (c *Cluster) validatePendingEngine(engine *cluster.Engine) bool {
|
|||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
// Only validate engines from pendingEngines list
|
||||
if _, exists := c.pendingEngines[engine.Addr]; !exists {
|
||||
return false
|
||||
}
|
||||
|
||||
// Make sure the engine ID is unique.
|
||||
if old, exists := c.engines[engine.ID]; exists {
|
||||
if old.Addr != engine.Addr {
|
||||
|
|
Loading…
Reference in New Issue