Merge pull request #1460 from mlaventure/pid-host-kill-init

Ensure all init children are dead when it exits
This commit is contained in:
Kenfe-Mickaël Laventure
2017-09-01 15:17:40 -07:00
committed by GitHub
7 changed files with 132 additions and 54 deletions

View File

@@ -367,7 +367,10 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
func (r *Runtime) cleanupAfterDeadShim(ctx context.Context, bundle *bundle, ns, id string, pid int, ec chan runc.Exit) error {
ctx = namespaces.WithNamespace(ctx, ns)
if err := r.terminate(ctx, bundle, ns, id); err != nil {
return errors.New("failed to terminate task, leaving bundle for debugging")
if r.config.ShimDebug {
return errors.Wrap(err, "failed to terminate task, leaving bundle for debugging")
}
log.G(ctx).WithError(err).Warn("failed to terminate task")
}
if ec != nil {