mirror of https://github.com/docker/docs.git
Fix a leaked process handle of the first container to start on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
089166ebe2
commit
717209c9ff
|
@ -167,6 +167,10 @@ func (ctr *container) waitExit(process *process, isFirstProcessToStart bool) err
|
||||||
// has exited to avoid a container being dropped on the floor.
|
// has exited to avoid a container being dropped on the floor.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := process.hcsProcess.Close(); err != nil {
|
||||||
|
logrus.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
// Assume the container has exited
|
// Assume the container has exited
|
||||||
si := StateInfo{
|
si := StateInfo{
|
||||||
CommonStateInfo: CommonStateInfo{
|
CommonStateInfo: CommonStateInfo{
|
||||||
|
@ -180,9 +184,6 @@ func (ctr *container) waitExit(process *process, isFirstProcessToStart bool) err
|
||||||
|
|
||||||
// But it could have been an exec'd process which exited
|
// But it could have been an exec'd process which exited
|
||||||
if !isFirstProcessToStart {
|
if !isFirstProcessToStart {
|
||||||
if err := process.hcsProcess.Close(); err != nil {
|
|
||||||
logrus.Error(err)
|
|
||||||
}
|
|
||||||
si.State = StateExitProcess
|
si.State = StateExitProcess
|
||||||
} else {
|
} else {
|
||||||
updatePending, err := ctr.hcsContainer.HasPendingUpdates()
|
updatePending, err := ctr.hcsContainer.HasPendingUpdates()
|
||||||
|
|
Loading…
Reference in New Issue