Merge pull request #3419 from AkihiroSuda/fix-task-start

runtime/v1/linux: ignore ErrCgroupDeleted in Task.Start
This commit is contained in:
Michael Crosby 2019-07-17 09:56:50 -04:00 committed by GitHub
commit 063a4ff278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,11 +124,15 @@ func (t *Task) Start(ctx context.Context) error {
t.pid = int(r.Pid) t.pid = int(r.Pid)
if !hasCgroup { if !hasCgroup {
cg, err := cgroups.Load(cgroups.V1, cgroups.PidPath(t.pid)) cg, err := cgroups.Load(cgroups.V1, cgroups.PidPath(t.pid))
if err != nil { if err != nil && err != cgroups.ErrCgroupDeleted {
return err return err
} }
t.mu.Lock() t.mu.Lock()
if err == cgroups.ErrCgroupDeleted {
t.cg = nil
} else {
t.cg = cg t.cg = cg
}
t.mu.Unlock() t.mu.Unlock()
} }
t.events.Publish(ctx, runtime.TaskStartEventTopic, &eventstypes.TaskStart{ t.events.Publish(ctx, runtime.TaskStartEventTopic, &eventstypes.TaskStart{