New oom sync (#257)
* Vendor in runc afaa21f79ade3b2e99a68f3f15e7219155aa4662 This updates the Dockerfile to use go 1.6.2 and install pkg-config are both are now needed by runc. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add support for runc create/start operation Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Remove dependency on runc state directory for OOM handler Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add OOM test Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
committed by
Michael Crosby
parent
cf554d59dd
commit
8040df4e89
@@ -413,7 +413,7 @@ func (c *container) Start(checkpointPath string, s Stdio) (Process, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.startCmd(InitProcessID, cmd, p); err != nil {
|
||||
if err := c.createCmd(InitProcessID, cmd, p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return p, nil
|
||||
@@ -453,13 +453,13 @@ func (c *container) Exec(pid string, pspec specs.ProcessSpec, s Stdio) (pp Proce
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.startCmd(pid, cmd, p); err != nil {
|
||||
if err := c.createCmd(pid, cmd, p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func (c *container) startCmd(pid string, cmd *exec.Cmd, p *process) error {
|
||||
func (c *container) createCmd(pid string, cmd *exec.Cmd, p *process) error {
|
||||
p.cmd = cmd
|
||||
if err := cmd.Start(); err != nil {
|
||||
if exErr, ok := err.(*exec.Error); ok {
|
||||
@@ -469,7 +469,7 @@ func (c *container) startCmd(pid string, cmd *exec.Cmd, p *process) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := c.waitForStart(p, cmd); err != nil {
|
||||
if err := c.waitForCreate(p, cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
c.processes[pid] = p
|
||||
@@ -552,7 +552,7 @@ type waitArgs struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func (c *container) waitForStart(p *process, cmd *exec.Cmd) error {
|
||||
func (c *container) waitForCreate(p *process, cmd *exec.Cmd) error {
|
||||
wc := make(chan error, 1)
|
||||
go func() {
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user