-
Notifications
You must be signed in to change notification settings - Fork 3.9k
11243::RLS cleanups #12085
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
Open
vimanikag
wants to merge
6
commits into
grpc:master
Choose a base branch
from
vimanikag:vimanikag-FIX_11243_RLS
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
11243::RLS cleanups #12085
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
84c05ba
11243::RLS cleanups test
vimanikag 6495235
11243::RLS cleanups test
vimanikag 901ce2b
11243::RLS cleanups test
vimanikag afdbe1e
11243 : RLS cleanups
vimanikag b1665ff
11243::RLS cleanups
vimanikag 44a715f
11243::RLS cleanups
vimanikag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making a private
onEviction()
method that calls the evictionListener and updates the estimatedSizeBytes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't reduce the visibility to private for onEviction() as it's overridden method and it's defined as public implicitly in EvictionListener interface , please let me know Your thoughts on this to take it forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a new private method, not in the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried the above suggested private method changes and observed the findings below. Hence I have followed the new approach , please review it and let me know Your thoughts on the current approach :
Observations with private onEvaction :
I have tried adding new private method to handle the Eviction type and avoided the current SizeHandlingEvictionListener onEviction code and observed it's casing the build failure due to CachingRlsLbClient.close internally using LinkedHashLruCache.close and most of the use cases are impacted with ClassCastException issues due to LinkedHashLruCache onEvaction has avoided(removed) as is not used.
CachingRlsLbClientTest > rls_withCustomRlsChannelServiceConfig FAILED java.lang.ClassCastException: class io.grpc.rls.LinkedHashLruCache$SizedValue cannot be cast to class io.grpc.rls.CachingRlsLbClient$CacheEntry (io.grpc.rls.LinkedHashLruCache$SizedValue and io.grpc.rls.CachingRlsLbClient$CacheEntry are in unnamed module of loader 'app') at io.grpc.rls.CachingRlsLbClient$AutoCleaningEvictionListener.onEviction(CachingRlsLbClient.java:854) at io.grpc.rls.LinkedHashLruCache.onEviction(LinkedHashLruCache.java:351) at io.grpc.rls.LinkedHashLruCache.invalidateAll(LinkedHashLruCache.java:190) at io.grpc.rls.LinkedHashLruCache.close(LinkedHashLruCache.java:288) at io.grpc.rls.CachingRlsLbClient.close(CachingRlsLbClient.java:356) at io.grpc.rls.CachingRlsLbClientTest.tearDown(CachingRlsLbClientTest.java:194)
We are getting above issue due to current LinkedHashLruCache onEvaction implementation has removed as it's not using with private onEvaction method and it's using other child class (CachingRlsLbClient) onEvaction implementation it's casing for ClassCastException issue while casting SizedValue with CacheEntry