Call start in containerd
This fixes a sync issue when the containerd api returns after a container has started. It fixes it by calling the runtime start inside containerd after the oom handler has been setup. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
14e79494da
commit
654c537d38
6 changed files with 54 additions and 30 deletions
|
@ -62,9 +62,23 @@ func (w *worker) Start() {
|
|||
}
|
||||
if err := w.s.monitorProcess(process); err != nil {
|
||||
logrus.WithField("error", err).Error("containerd: add process to monitor")
|
||||
t.Err <- err
|
||||
evt := &DeleteTask{
|
||||
ID: t.Container.ID(),
|
||||
NoEvent: true,
|
||||
}
|
||||
w.s.SendTask(evt)
|
||||
continue
|
||||
}
|
||||
if err := process.Start(); err != nil {
|
||||
logrus.WithField("error", err).Error("containerd: start init process")
|
||||
t.Err <- err
|
||||
evt := &DeleteTask{
|
||||
ID: t.Container.ID(),
|
||||
NoEvent: true,
|
||||
}
|
||||
w.s.SendTask(evt)
|
||||
continue
|
||||
}
|
||||
ContainerStartTimer.UpdateSince(started)
|
||||
t.Err <- nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue