Set oom_score_adj before we send the config to avoid race
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
4d7929274d
commit
69db69668e
|
@ -85,13 +85,13 @@ func (p *setnsProcess) start() (err error) {
|
||||||
return newSystemError(err)
|
return newSystemError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := utils.WriteJSON(p.parentPipe, p.config); err != nil {
|
|
||||||
return newSystemError(err)
|
|
||||||
}
|
|
||||||
// set oom_score_adj
|
// set oom_score_adj
|
||||||
if err := setOomScoreAdj(p.config.Config.OomScoreAdj, p.pid()); err != nil {
|
if err := setOomScoreAdj(p.config.Config.OomScoreAdj, p.pid()); err != nil {
|
||||||
return newSystemError(err)
|
return newSystemError(err)
|
||||||
}
|
}
|
||||||
|
if err := utils.WriteJSON(p.parentPipe, p.config); err != nil {
|
||||||
|
return newSystemError(err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := syscall.Shutdown(int(p.parentPipe.Fd()), syscall.SHUT_WR); err != nil {
|
if err := syscall.Shutdown(int(p.parentPipe.Fd()), syscall.SHUT_WR); err != nil {
|
||||||
return newSystemError(err)
|
return newSystemError(err)
|
||||||
|
|
Loading…
Reference in New Issue