Repository navigation
chore: bump kubedog to stop leaking informers after tracking - #813
Merged
Merged
Conversation
Bumps github.com/werf/kubedog to 1ed920d (werf/kubedog#406). Informer event handlers no longer block on tracker channels after tracking ends, so long-lived processes stop accumulating informers and their caches. Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Contributor
Author
Verification
Review focus
Follow-up
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
github.com/werf/kubedogto the merge commit of werf/kubedog#406 on kubedogmain(1ed920d). A long-lived process that runsnelmrelease actions over and over with tracking (for example, a controller that deploys a release on every reconcile) no longer accumulates informers that hold the cache of a resource type for a whole namespace after each action ends. Before, the memory such a process held grew with every deploy until it restarted.What
go.mod/go.sum:github.com/werf/kubedogv0.13.1-0.20261029011008-97f4f131413e→v0.13.1-0.20261103160714-1ed920dee18b. The range97f4f13..1ed920dis the single commit of fix: stop leaking informers and their caches after tracking ends kubedog#406.pkg/dyntrackeruses.utils.SendOrDone(ctx, ch, v). Nothing in thenelmAPI changes.go.mod:golang.org/x/sync v0.20.0moves from the indirect to the direct block, same version.pkg/resource/spec/patches_debug_test.go(feat: support debug in jq patches #785) already imports it directly;go mod tidyonmainwithout this bump makes the same change.Why
Informer event handlers run in the client-go listener goroutine and sent to tracker channels without watching for cancellation. When a handler had more events to deliver than the channel could buffer at the moment the tracker stopped reading (e.g. the initial Add events for several Pods of a Deployment that is already ready), the send blocked forever, the informer stayed in
wg.Wait()after the stop signal, and its indexer stayed referenced. 38643e9 in kubedog (brought in by #780) fixed this for the ReplicaSet informer only. Bigger channel buffers only move the threshold, since the number of objects an informer replays on start is unbounded.BEGIN_COMMIT_OVERRIDE
fix: stop leaking informers and their caches after tracking
END_COMMIT_OVERRIDE