Don't call runc start when restoring a checkpoint (#302)
The create/start split left checkpoint/restore broken in that the create side was calling runc restore, which fully restores the process to operation, leaving a call to `runc start` as an error (process already started). This patch skips process.Start as it is an unnecessary (and wrong) step for a restored checkpoint. Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
parent
edc124c8e7
commit
8508d2bec9
1 changed files with 13 additions and 9 deletions
|
@ -72,16 +72,20 @@ func (w *worker) Start() {
|
|||
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,
|
||||
Process: process,
|
||||
// only call process start if we aren't restoring from a checkpoint
|
||||
// if we have restored from a checkpoint then the process is already started
|
||||
if t.CheckpointPath == "" {
|
||||
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,
|
||||
Process: process,
|
||||
}
|
||||
w.s.SendTask(evt)
|
||||
continue
|
||||
}
|
||||
w.s.SendTask(evt)
|
||||
continue
|
||||
}
|
||||
ContainerStartTimer.UpdateSince(started)
|
||||
t.Err <- nil
|
||||
|
|
Loading…
Reference in a new issue