Fix race between execdriver.Kill and execdriver.Run

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ca7219f5daa194ae714c3a3396703e08d8a137c8
Component: engine
This commit is contained in:
Alexander Morozov
2015-05-11 13:23:50 -07:00
parent a9a448c762
commit c578ab5fb7
@@ -245,7 +245,9 @@ func waitInPIDHost(p *libcontainer.Process, c libcontainer.Container) func() (*o
}
func (d *driver) Kill(c *execdriver.Command, sig int) error {
d.Lock()
active := d.activeContainers[c.ID]
d.Unlock()
if active == nil {
return fmt.Errorf("active container for %s does not exist", c.ID)
}