瀏覽代碼

Merge pull request #11295 from LK4D4/oom_after_dead

Check oom status after container stopped in lxc driver
Michael Crosby 10 年之前
父節點
當前提交
0c2eb5ebfb
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      daemon/execdriver/lxc/driver.go

+ 3 - 3
daemon/execdriver/lxc/driver.go

@@ -256,16 +256,16 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
 
 
 	oomKill := false
 	oomKill := false
 	oomKillNotification, err := notifyOnOOM(cgroupPaths)
 	oomKillNotification, err := notifyOnOOM(cgroupPaths)
+
+	<-waitLock
+
 	if err == nil {
 	if err == nil {
 		_, oomKill = <-oomKillNotification
 		_, oomKill = <-oomKillNotification
 		log.Debugf("oomKill error %s waitErr %s", oomKill, waitErr)
 		log.Debugf("oomKill error %s waitErr %s", oomKill, waitErr)
-
 	} else {
 	} else {
 		log.Warnf("Your kernel does not support OOM notifications: %s", err)
 		log.Warnf("Your kernel does not support OOM notifications: %s", err)
 	}
 	}
 
 
-	<-waitLock
-
 	// check oom error
 	// check oom error
 	exitCode := getExitCode(c)
 	exitCode := getExitCode(c)
 	if oomKill {
 	if oomKill {