diff --git a/pkg/custompluginmonitor/plugin/plugin.go b/pkg/custompluginmonitor/plugin/plugin.go index 5558a8f2..4a548dba 100644 --- a/pkg/custompluginmonitor/plugin/plugin.go +++ b/pkg/custompluginmonitor/plugin/plugin.go @@ -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)