mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Merge pull request #35501 from cpuguy83/lock_while_stopping_healthcheck
Fix some issues with locking on the container Upstream-commit: 3d80a692d146e10282bacc0dd2698ffd32dcdaae Component: engine
This commit is contained in:
@@ -64,6 +64,8 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, sig int)
|
||||
container.Lock()
|
||||
defer container.Unlock()
|
||||
|
||||
daemon.stopHealthchecks(container)
|
||||
|
||||
if !container.Running {
|
||||
return errNotRunning(container.ID)
|
||||
}
|
||||
|
||||
@@ -39,10 +39,14 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc
|
||||
if runtime.GOOS == "windows" {
|
||||
return errors.New("received StateOOM from libcontainerd on Windows. This should never happen")
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
daemon.updateHealthMonitor(c)
|
||||
if err := c.CheckpointTo(daemon.containersReplica); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
daemon.LogContainerEvent(c, "oom")
|
||||
case libcontainerd.EventExit:
|
||||
if int(ei.Pid) == c.Pid {
|
||||
|
||||
@@ -43,8 +43,6 @@ func (daemon *Daemon) containerStop(container *containerpkg.Container, seconds i
|
||||
return nil
|
||||
}
|
||||
|
||||
daemon.stopHealthchecks(container)
|
||||
|
||||
stopSignal := container.StopSignal()
|
||||
// 1. Send a stop signal
|
||||
if err := daemon.killPossiblyDeadProcess(container, stopSignal); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user