mirror of
https://github.com/docker/docs.git
synced 2026-04-02 01:08:53 +07:00
Merge pull request #1658 from dongluochen/raceValidation
Fix a race condition in pending engine validation
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user