mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #38737 from thaJeztah/fix_stopped_restart_containers
Fix stopped containers with restart-policy showing as "restarting"
This commit is contained in:
commit
348d793351
1 changed files with 5 additions and 2 deletions
|
@ -85,6 +85,8 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc
|
||||||
}
|
}
|
||||||
daemon.LogContainerEventWithAttributes(c, "die", attributes)
|
daemon.LogContainerEventWithAttributes(c, "die", attributes)
|
||||||
daemon.Cleanup(c)
|
daemon.Cleanup(c)
|
||||||
|
daemon.setStateCounter(c)
|
||||||
|
cpErr := c.CheckpointTo(daemon.containersReplica)
|
||||||
|
|
||||||
if err == nil && restart {
|
if err == nil && restart {
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -101,6 +103,8 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Lock()
|
c.Lock()
|
||||||
c.SetStopped(&exitStatus)
|
c.SetStopped(&exitStatus)
|
||||||
|
daemon.setStateCounter(c)
|
||||||
|
c.CheckpointTo(daemon.containersReplica)
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
defer daemon.autoRemove(c)
|
defer daemon.autoRemove(c)
|
||||||
if err != restartmanager.ErrRestartCanceled {
|
if err != restartmanager.ErrRestartCanceled {
|
||||||
|
@ -110,8 +114,7 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
daemon.setStateCounter(c)
|
return cpErr
|
||||||
return c.CheckpointTo(daemon.containersReplica)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if execConfig := c.ExecCommands.Get(ei.ProcessID); execConfig != nil {
|
if execConfig := c.ExecCommands.Get(ei.ProcessID); execConfig != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue