-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Make RateLimiter not Customizable #10378
Conversation
This pull request was exported from Phabricator. Differential Revision: D37914865 |
This pull request was exported from Phabricator. Differential Revision: D37914865 |
Summary: (PR created for informational/testing purposes only.) - Fixes lost dynamic updates to GenericRateLimiter bandwidth using `SetBytesPerSecond()` - Benefit over facebook#10374 is eliminating race conditions with Configurable framework. Pull Request resolved: facebook#10378 Differential Revision: D37914865 fbshipit-source-id: e2b455eb30058f9eea5fb2af870eaa7c77da6969
This pull request was exported from Phabricator. Differential Revision: D37914865 |
Summary: (PR created for informational/testing purposes only.) - Fixes lost dynamic updates to GenericRateLimiter bandwidth using `SetBytesPerSecond()` - Benefit over #10374 is eliminating race conditions with Configurable framework. Pull Request resolved: #10378 Reviewed By: pdillinger Differential Revision: D37914865 fbshipit-source-id: d4f566d60ec9726d26932388c61671adf0ee0f30
This is a blunt way to fix a bug in the GenericRateLimiter. This change prevents anyone from writing their own pluggable rate limiter. It also prevents creating one from the OPTIONS file. This change is likely to break version compatibilty. Most of this is unnecessary and can be solved in other means that would still allow a user or company to create pluggable Rate Limiters |
One thought regarding this: if multiple databases share the same rate limiter instance, and application calls |
Summary: (PR created for informational/testing purposes only.) - Fixes lost dynamic updates to GenericRateLimiter bandwidth using `SetBytesPerSecond()` - Benefit over #10374 is eliminating race conditions with Configurable framework. Pull Request resolved: #10378 Reviewed By: pdillinger Differential Revision: D37914865 fbshipit-source-id: d4f566d60ec9726d26932388c61671adf0ee0f30
Summary: Made locking strict for all accesses of `GenericRateLimiter` internal state. `SetBytesPerSecond()` was the main problem since it had no locking, while the two updates it makes need to be done as one atomic operation. The test case, "ConfigOptionsTest.ConfiguringOptionsDoesNotRevertRateLimiterBandwidth", is for the issue fixed in #10378, but I forgot to include the test there. Pull Request resolved: #10374 Reviewed By: pdillinger Differential Revision: D37906367 Pulled By: ajkr fbshipit-source-id: ccde620d2a7f96d1401bdafd2bdb685cbefbafa5
Differential Revision: D37914865
(PR created for informational/testing purposes only.)
SetBytesPerSecond()