mirror of https://github.com/docker/docs.git
Merge pull request #3705 from crosbymichael/fix-die-event
Fix die command when monitor returns
This commit is contained in:
commit
cb33f739a1
|
@ -1141,9 +1141,7 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if container.runtime != nil && container.runtime.srv != nil {
|
utils.Errorf("Error running container: %s", err)
|
||||||
container.runtime.srv.LogEvent("die", container.ID, container.runtime.repositories.ImageName(container.Image))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
@ -1156,6 +1154,10 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
|
||||||
|
|
||||||
container.State.SetStopped(exitCode)
|
container.State.SetStopped(exitCode)
|
||||||
|
|
||||||
|
if container.runtime != nil && container.runtime.srv != nil {
|
||||||
|
container.runtime.srv.LogEvent("die", container.ID, container.runtime.repositories.ImageName(container.Image))
|
||||||
|
}
|
||||||
|
|
||||||
close(container.waitLock)
|
close(container.waitLock)
|
||||||
|
|
||||||
// FIXME: there is a race condition here which causes this to fail during the unit tests.
|
// FIXME: there is a race condition here which causes this to fail during the unit tests.
|
||||||
|
|
Loading…
Reference in New Issue