mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 11:25:41 +03:00
Put the executor into the cgroup to avoid a fork race
This commit is contained in:
@@ -286,7 +286,9 @@ func (d *JavaDriver) Open(ctx *ExecContext, handleID string) (DriverHandle, erro
|
||||
merrs.Errors = append(merrs.Errors, fmt.Errorf("error destroying plugin and userpid: %v", e))
|
||||
}
|
||||
if id.IsolationConfig != nil {
|
||||
if e := executor.DestroyCgroup(id.IsolationConfig.Cgroup, id.IsolationConfig.CgroupPaths); e != nil {
|
||||
isoConf := id.IsolationConfig
|
||||
ePid := pluginConfig.Reattach.Pid
|
||||
if e := executor.DestroyCgroup(isoConf.Cgroup, isoConf.CgroupPaths, ePid); e != nil {
|
||||
merrs.Errors = append(merrs.Errors, fmt.Errorf("destroying cgroup failed: %v", e))
|
||||
}
|
||||
}
|
||||
@@ -383,7 +385,9 @@ func (h *javaHandle) run() {
|
||||
close(h.doneCh)
|
||||
if ps.ExitCode == 0 && err != nil {
|
||||
if h.isolationConfig != nil {
|
||||
if e := executor.DestroyCgroup(h.isolationConfig.Cgroup, h.isolationConfig.CgroupPaths); e != nil {
|
||||
isoConf := h.isolationConfig
|
||||
ePid := h.pluginClient.ReattachConfig().Pid
|
||||
if e := executor.DestroyCgroup(isoConf.Cgroup, isoConf.CgroupPaths, ePid); e != nil {
|
||||
h.logger.Printf("[ERR] driver.java: destroying cgroup failed while killing cgroup: %v", e)
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user