mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Grab a lock to read container.RemovalInProgress
Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
This commit is contained in:
parent
8a672ba1aa
commit
481a92cb41
1 changed files with 4 additions and 2 deletions
|
@ -271,6 +271,7 @@ func (daemon *Daemon) restore() error {
|
|||
}
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
if c.RemovalInProgress {
|
||||
// We probably crashed in the middle of a removal, reset
|
||||
// the flag.
|
||||
|
@ -281,10 +282,11 @@ func (daemon *Daemon) restore() error {
|
|||
// be removed. So we put the container in the "dead"
|
||||
// state and leave further processing up to them.
|
||||
logrus.Debugf("Resetting RemovalInProgress flag from %v", c.ID)
|
||||
c.ResetRemovalInProgress()
|
||||
c.SetDead()
|
||||
c.RemovalInProgress = false
|
||||
c.Dead = true
|
||||
c.ToDisk()
|
||||
}
|
||||
c.Unlock()
|
||||
}(c)
|
||||
}
|
||||
wg.Wait()
|
||||
|
|
Loading…
Reference in a new issue