mirror of https://github.com/docker/docs.git
update container's state after we close the waitLock
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
This commit is contained in:
parent
58a0e8af8a
commit
1de52caedc
|
@ -468,6 +468,20 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
|
||||||
utils.Errorf("Error running container: %s", err)
|
utils.Errorf("Error running container: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
container.cleanup()
|
||||||
|
|
||||||
|
// Re-create a brand new stdin pipe once the container exited
|
||||||
|
if container.Config.OpenStdin {
|
||||||
|
container.stdin, container.stdinPipe = io.Pipe()
|
||||||
|
}
|
||||||
|
|
||||||
|
if container.daemon != nil && container.daemon.srv != nil {
|
||||||
|
container.daemon.srv.LogEvent("die", container.ID, container.daemon.repositories.ImageName(container.Image))
|
||||||
|
}
|
||||||
|
|
||||||
|
close(container.waitLock)
|
||||||
|
|
||||||
if container.daemon != nil && container.daemon.srv != nil && container.daemon.srv.IsRunning() {
|
if container.daemon != nil && container.daemon.srv != nil && container.daemon.srv.IsRunning() {
|
||||||
container.State.SetStopped(exitCode)
|
container.State.SetStopped(exitCode)
|
||||||
|
|
||||||
|
@ -483,20 +497,6 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
container.cleanup()
|
|
||||||
|
|
||||||
// Re-create a brand new stdin pipe once the container exited
|
|
||||||
if container.Config.OpenStdin {
|
|
||||||
container.stdin, container.stdinPipe = io.Pipe()
|
|
||||||
}
|
|
||||||
|
|
||||||
if container.daemon != nil && container.daemon.srv != nil {
|
|
||||||
container.daemon.srv.LogEvent("die", container.ID, container.daemon.repositories.ImageName(container.Image))
|
|
||||||
}
|
|
||||||
|
|
||||||
close(container.waitLock)
|
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue