fix check for timeout

Signed-off-by: zhangyue <huaihuan.zy@alibaba-inc.com>
This commit is contained in:
zhangyue
2021-01-30 21:35:00 +08:00
parent e34e2763cf
commit 98ba606d4f
+3
View File
@@ -175,6 +175,9 @@ func (p *Plugin) run(rule cpmtypes.CustomRule) (exitStatus cpmtypes.Status, outp
go func() {
select {
case <-ctx.Done():
if ctx.Err() == context.Canceled {
return
}
glog.Errorf("Error in running plugin timeout %q", rule.Path)
if cmd.Process == nil || cmd.Process.Pid == 0 {
glog.Errorf("Error in cmd.Process check %q", rule.Path)