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

Stop flooding cache logs on client disconnection/context cancelation #1347

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

mariomac
Copy link
Contributor

Fixes: #1323

Also solves a potential leak where failed clients might be still running their goroutine.

Unverified

This user has not yet uploaded their public signing key.
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

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

Project coverage is 80.78%. Comparing base (e09e0df) to head (0bf2ca8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/kubecache/meta/informers.go 17.39% 15 Missing and 4 partials ⚠️
pkg/internal/kube/store.go 33.33% 8 Missing and 2 partials ⚠️
pkg/kubecache/meta/observer.go 37.50% 8 Missing and 2 partials ⚠️
pkg/kubecache/service/service.go 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1347      +/-   ##
==========================================
- Coverage   81.06%   80.78%   -0.29%     
==========================================
  Files         145      145              
  Lines       14558    14595      +37     
==========================================
- Hits        11802    11791      -11     
- Misses       2188     2226      +38     
- Partials      568      578      +10     
Flag Coverage Δ
integration-test 58.90% <5.08%> (-0.13%) ⬇️
k8s-integration-test 59.46% <37.31%> (-0.22%) ⬇️
oats-test 34.34% <0.00%> (-0.08%) ⬇️
unittests 51.85% <31.34%> (-0.14%) ⬇️

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.

}
// the IPInfos could contain IPInfo data from Pods already sent in the previous loop
// is the subscriber the one that should decide whether to ignore such duplicates or
// incomplete info
for _, ips := range s.objectMetaByIP {
observer.On(&informer.Event{Type: informer.EventType_CREATED, Resource: ips})
if err := observer.On(&informer.Event{Type: informer.EventType_CREATED, Resource: ips}); err != nil {
s.log.Debug("observer failed. Unsubscribing it", "observer", observer.ID(), "error", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

is it worth to say in this line that is the observer for IPs? basically to differentiate from the previous logger

Unverified

This user has not yet uploaded their public signing key.
@mariomac mariomac merged commit 5998c47 into grafana:main Nov 11, 2024
@mariomac mariomac deleted the fix-flood branch November 11, 2024 13:09
mattdurham pushed a commit to mattdurham/beyla that referenced this pull request Jan 22, 2025

Unverified

This user has not yet uploaded their public signing key.
…rafana#1347)

* Stop flooding cache logs on client disconnection/context cancelation

* differentiate log messages
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.

K8s cache: do not flood logs when there is a client connection issue
2 participants