rls:Fix throttling in route lookup (b/262779100)#9874
Merged
larry-safran merged 12 commits intogrpc:masterfrom Feb 6, 2023
Merged
rls:Fix throttling in route lookup (b/262779100)#9874larry-safran merged 12 commits intogrpc:masterfrom
larry-safran merged 12 commits intogrpc:masterfrom
Conversation
…into b262779100
temawi
reviewed
Feb 3, 2023
Contributor
temawi
left a comment
There was a problem hiding this comment.
Some test code would also be good. This change might be hard to test in a pure unit test, but if we had a test that used CachingRlsLbclient together with AdaptiveThrottler, this issue would have been caught long time ago.
ejona86
reviewed
Feb 3, 2023
Update test get_updatesLbState to check that the right values were registered for the throttler.
Update test get_updatesLbState to check that the right values were registered for the throttler.
temawi
approved these changes
Feb 6, 2023
Contributor
temawi
left a comment
There was a problem hiding this comment.
Thanks Larry - looks to me these new tests would have caught the problem.
| assertThat(adaptiveThrottler.throttledStat.get(time)).isEqualTo(1L); | ||
| } | ||
|
|
||
| private PickSubchannelArgsImpl getInvalidArgs(Metadata headers) { |
Contributor
There was a problem hiding this comment.
minor style nit: Methods starting with get usually return something that already exists. I think a prefix of new (or create, etc.) is better suited for methods that create new objects.
larry-safran
added a commit
to larry-safran/grpc-java
that referenced
this pull request
Feb 7, 2023
* Correct value being passed to throttler which had been backwards. * Fix flaky test. * Add a test using AdaptiveThrottler with a CachingRlsLBClient. * Address test flakiness.
larry-safran
added a commit
that referenced
this pull request
Feb 7, 2023
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes b/262779100
Previously, registerBackendResponse was being passed the opposite value from what it should have been. Thus, successes were being registered as throttled and all errors were registered as not throttled by the backend. Now it is only registered as throttled when there is an error and the cause is a ThrottledException.