Skip to content

Commit

Permalink
Merge pull request #6323 from jepio/jepio/fix-cgroupv2-oom-event
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweid committed Mar 24, 2022
2 parents 992f5d4 + 7275411 commit e7cba85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/oom/v2/v2.go
Expand Up @@ -71,15 +71,15 @@ func (w *watcher) Run(ctx context.Context) {
continue
}
lastOOM := lastOOMMap[i.id]
if i.ev.OOM > lastOOM {
if i.ev.OOMKill > lastOOM {
if err := w.publisher.Publish(ctx, runtime.TaskOOMEventTopic, &eventstypes.TaskOOM{
ContainerID: i.id,
}); err != nil {
logrus.WithError(err).Error("publish OOM event")
}
}
if i.ev.OOM > 0 {
lastOOMMap[i.id] = i.ev.OOM
if i.ev.OOMKill > 0 {
lastOOMMap[i.id] = i.ev.OOMKill
}
}
}
Expand Down

0 comments on commit e7cba85

Please sign in to comment.