Retrieve container PID from conmon

Instead of running a full sync after starting a container to pick
up its PID, grab it from Conmon instead.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
Matthew Heon 2018-10-25 13:35:39 -04:00
parent 94763a47a6
commit 3286b0185d
2 changed files with 1 additions and 5 deletions

View File

@ -734,11 +734,6 @@ func (c *Container) start() error {
}
logrus.Debugf("Started container %s", c.ID())
// We need to pick up full container state, including PID.
if err := c.runtime.ociRuntime.updateContainerStatus(c, true); err != nil {
return err
}
return c.save()
}

View File

@ -441,6 +441,7 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res
}
return errors.Wrapf(ErrInternal, "container create failed")
}
ctr.state.PID = ss.si.Pid
case <-time.After(ContainerCreateTimeout):
return errors.Wrapf(ErrInternal, "container creation timeout")
}