diff --git a/hypervisor/context.go b/hypervisor/context.go index 017c1d16..7f53af71 100644 --- a/hypervisor/context.go +++ b/hypervisor/context.go @@ -244,6 +244,15 @@ func (ctx *VmContext) handleProcessAsyncEvent(pae *hyperstartapi.ProcessAsyncEve ctx.reportProcessFinished(types.E_CONTAINER_FINISHED, &types.ProcessFinished{ Id: pae.Container, Code: uint8(pae.Status), Ack: make(chan bool, 1), }) + ctx.lock.Lock() + if c, ok := ctx.containers[pae.Container]; ok { + c.Log(TRACE, "container finished, unset iostream pipes") + c.stdinPipe = nil + c.stdoutPipe = nil + c.stderrPipe = nil + c.tty = nil + } + ctx.lock.Unlock() } else { ctx.DeleteExec(pae.Process) ctx.reportProcessFinished(types.E_EXEC_FINISHED, &types.ProcessFinished{