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:
Phil Estes 2016-08-26 13:25:19 -04:00 committed by Michael Crosby
parent edc124c8e7
commit 8508d2bec9

View file

@ -72,16 +72,20 @@ func (w *worker) Start() {
w.s.SendTask(evt) w.s.SendTask(evt)
continue continue
} }
if err := process.Start(); err != nil { // only call process start if we aren't restoring from a checkpoint
logrus.WithField("error", err).Error("containerd: start init process") // if we have restored from a checkpoint then the process is already started
t.Err <- err if t.CheckpointPath == "" {
evt := &DeleteTask{ if err := process.Start(); err != nil {
ID: t.Container.ID(), logrus.WithField("error", err).Error("containerd: start init process")
NoEvent: true, t.Err <- err
Process: process, evt := &DeleteTask{
ID: t.Container.ID(),
NoEvent: true,
Process: process,
}
w.s.SendTask(evt)
continue
} }
w.s.SendTask(evt)
continue
} }
ContainerStartTimer.UpdateSince(started) ContainerStartTimer.UpdateSince(started)
t.Err <- nil t.Err <- nil