Browse code

Merge pull request #26124 from darrenstahlmsft/RestoreLock

Lock concurrent access to remove map during Daemon restore

Vincent Demeester authored on 2016/08/30 20:06:01
Showing 1 changed files
... ...
@@ -201,7 +201,9 @@ func (daemon *Daemon) restore() error {
201 201
 					restartContainers[c] = make(chan struct{})
202 202
 					mapLock.Unlock()
203 203
 				} else if c.HostConfig != nil && c.HostConfig.AutoRemove {
204
+					mapLock.Lock()
204 205
 					removeContainers[c.ID] = c
206
+					mapLock.Unlock()
205 207
 				}
206 208
 			}
207 209