Fix exit event handling in shim

Could issues where when exec processes fail the wait block is not
released.

Second, you could not dump stacks if the reaper loop locks up.

Third, the publisher was not waiting on the correct pid.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-11-28 14:17:22 -05:00
parent 723f37d846
commit 74b3cb3391
4 changed files with 18 additions and 7 deletions

View File

@@ -143,6 +143,7 @@ func (e *execProcess) start(ctx context.Context) (err error) {
opts.ConsoleSocket = socket
}
if err := e.parent.runtime.Exec(ctx, e.parent.id, e.spec, opts); err != nil {
close(e.waitBlock)
return e.parent.runtimeError(err, "OCI runtime exec failed")
}
if e.stdio.Stdin != "" {