-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
rls:Fix throttling in route lookup (b/262779100) #9874
Conversation
…into b262779100
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.
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.
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 think it's clear we really need a test here. Did that turn out to not be readily feasible (especially given the soon release date)? (Edit: doh, I missed Terry's comment)
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.
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.
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) { |
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.
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.
* Correct value being passed to throttler which had been backwards. * Fix flaky test. * Add a test using AdaptiveThrottler with a CachingRlsLBClient. * Address test flakiness.
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.