fix: stop leaked watch streams when pool-scope metadata is removed - #2755
Open
WorrierKhushal wants to merge 1 commit into
Open
fix: stop leaked watch streams when pool-scope metadata is removed#2755WorrierKhushal wants to merge 1 commit into
WorrierKhushal wants to merge 1 commit into
Conversation
|
Contributor
Author
|
Hi @rambohe-ch @luc99hen @wawlian @carolove Sir i am khushal , I have submitted a pull request fixing issue #2753 ([BUG] Multiplexer watch streams leak indefinitely when pool-scope metadata is removed from Leader Hub ConfigMap). Key Fix Details:
All tests ( Whenever you have some time, could you please take a look and share your feedback? Thanks! |
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.



What type of PR is this?
/kind bug
What this PR does / why we need it:
MultiplexerManager.updateLeaderHubConfigurationwas supposed to teardown watch streams for resources removed from
pool-scoped-metadata,but it was querying two dead fields (
lazyLoadedGVRCache,lazyLoadedGVRCacheDestroyFunc) left over from a past refactor — thesewere initialized but never populated anywhere, so the cleanup logic
never actually ran. Meanwhile, the real cache instances live in
filterStoreManager, butDeleteFilterStoreonly removed the map entrywithout calling
Destroy()on the underlyingfilterStore, so thewatch stream and its resources (goroutines, memory, network connection)
kept running indefinitely even after the resource was removed from
pool-scoped-metadata.This PR:
filterStoreManager.DeleteFilterStorecallfs.Destroy()before removing the entry.
updateLeaderHubConfigurationto callm.filterStoreManager.DeleteFilterStore(gvrStr)directly instead ofthe dead-map logic.
lazyLoadedGVRCache/lazyLoadedGVRCacheDestroyFuncfields.Added a test verifying that removing a GVR from pool-scoped-metadata
actually invokes
Destroy()on its filter store.Which issue(s) this PR fixes:
Fixes #2753
Special notes for your reviewer:
go test -v ./pkg/yurthub/multiplexer/...— all tests pass, including the new oneGOOS=linux go build ./...andgo vet ./pkg/yurthub/multiplexer/...— both cleangrep -r "lazyLoadedGVRCache" pkg/yurthub/— zero remaining references, confirming safe removalDoes this PR introduce a user-facing change?
other Note