shim: change the log level for GetOOMEvent call failures

GetOOMEvent is a blocking call that will fail if
the container exit, in this case, it's not an error or warning.

Changing the log level for logs in case of GetOOMEvent call fails
will reduce log noise in a large cluster that has pods
creating/deleting frequently.

Fixes: #4376

Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
Bin Liu 2022-06-08 22:17:24 +08:00
parent a238d8c6bd
commit eff4e1017d

View File

@ -158,10 +158,10 @@ func watchOOMEvents(ctx context.Context, s *service) {
containerID, err := s.sandbox.GetOOMEvent(ctx)
if err != nil {
if err.Error() == "ttrpc: closed" || err.Error() == "Dead agent" {
shimLog.WithError(err).Warn("agent has shutdown, return from watching of OOM events")
shimLog.WithError(err).Info("agent has shutdown, return from watching of OOM events")
return
}
shimLog.WithError(err).Warn("failed to get OOM event from sandbox")
shimLog.WithError(err).Info("failed to get OOM event from sandbox")
time.Sleep(defaultCheckInterval)
continue
}