From d665ca8dc053838c5d4d284e13c0f166cd51df6b Mon Sep 17 00:00:00 2001 From: Darren Stahl Date: Mon, 29 Aug 2016 16:58:01 -0700 Subject: [PATCH] Lock concurrent access to remove map during Daemon restore Signed-off-by: Darren Stahl --- daemon/daemon.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/daemon.go b/daemon/daemon.go index ace5df8ab5..efe7b0942a 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -201,7 +201,9 @@ func (daemon *Daemon) restore() error { restartContainers[c] = make(chan struct{}) mapLock.Unlock() } else if c.HostConfig != nil && c.HostConfig.AutoRemove { + mapLock.Lock() removeContainers[c.ID] = c + mapLock.Unlock() } }