Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix informers on stale object deletion #1420

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Conversation

mariomac
Copy link
Contributor

Some Beyla pods suddenly had an inusual memory generation, affecting also CPU due to constant garbage collections:

image

At the time the memory and garbage collection started to go mad, there is a log message like this:

W1128 10:31:37.371693       1 reflector.go:462] k8s.io/client-go/informers/factory.go:159: watch of *v1.Pod ended with: very short watch: k8s.io/client-go/informers/factory.go:159: Unexpected watch close - watch lasted less than a second and no items received

Followed by many log messages like:

E1128 10:32:21.406329       1 reflector.go:147] k8s.io/client-go/informers/factory.go:159: Failed to watch *v1.Pod: unable to sync list result: was expecting a *v1.Pod. Got: cache.DeletedFinalStateUnknown

This PR handles the cache.DeletedFinalStateUnknown event to delete anyway the object that is associated to it.

@mariomac mariomac marked this pull request as ready for review November 29, 2024 14:03
Copy link
Contributor

@marctc marctc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 54.34783% with 42 lines in your changes missing coverage. Please review.

Project coverage is 80.95%. Comparing base (77046c4) to head (6ed0631).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/kubecache/meta/informers_init.go 54.34% 39 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1420      +/-   ##
==========================================
+ Coverage   72.30%   80.95%   +8.64%     
==========================================
  Files         145      146       +1     
  Lines       14893    14925      +32     
==========================================
+ Hits        10768    12082    +1314     
+ Misses       3405     2256    -1149     
+ Partials      720      587     -133     
Flag Coverage Δ
integration-test 58.98% <0.00%> (-0.14%) ⬇️
k8s-integration-test 60.06% <54.34%> (+0.02%) ⬆️
oats-test 33.97% <0.00%> (+<0.01%) ⬆️
unittests 51.57% <29.34%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mariomac mariomac merged commit 26bd308 into grafana:main Nov 29, 2024
13 checks passed
@mariomac mariomac deleted the fix-informers branch November 29, 2024 14:44
mariomac added a commit to mariomac/beyla that referenced this pull request Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants