Skip to content

Commit

Permalink
Merge pull request #6735 from AkihiroSuda/cherrypick-6323-1.5
Browse files Browse the repository at this point in the history
[release/1.5 backport] cgroup2: monitor OOMKill instead of OOM to prevent missing container events
  • Loading branch information
estesp committed Mar 24, 2022
2 parents 3df54a8 + 1c68f50 commit a553ec5
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 a553ec5

Please sign in to comment.