Handle SIGKILL'ed shim while daemon is running

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-15 11:37:53 -07:00
parent c23f29ebce
commit d541567119
8 changed files with 314 additions and 54 deletions

View File

@@ -2,10 +2,10 @@ package runtime
import (
"context"
"errors"
"sync"
"github.com/containerd/containerd/namespaces"
"github.com/pkg/errors"
)
var (
@@ -75,7 +75,7 @@ func (l *TaskList) AddWithNamespace(namespace string, t Task) error {
l.tasks[namespace] = make(map[string]Task)
}
if _, ok := l.tasks[namespace][id]; ok {
return ErrTaskAlreadyExists
return errors.Wrap(ErrTaskAlreadyExists, id)
}
l.tasks[namespace][id] = t
return nil