Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[RateLimiter] Add support for long intervals (months and years)#43060
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[RateLimiter] Add support for long intervals (months and years)#43060
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bed13d3 tofcfde37Comparederrabus commentedSep 16, 2021
Tests please. 🙂 |
alexandre-daubois commentedSep 16, 2021
@derrabus indeed! Wasn't sure which tests to add though. But I'll definitely try to find some! 😄 |
derrabus commentedSep 16, 2021
Well, you should be able to come up with a test that fails on 5.4 and passes after your changes. After all, you're fixing a problem here. 😎 |
alexandre-daubois commentedSep 16, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Oh yeah of course you're right! Just added them. If you see anything else, please tell me! Speaking of that, should this be rebased to 5.3 as a bug fix or is it considered as a feature and 5.4 is fine? |
fcfde37 todd44a83Comparefabpot commentedSep 17, 2021
That’s a new feature |
a3bcb2b toa1d2d61Compare| yield ['PT2H4M',2 *3600 +4 *60]; | ||
| yield ['P1Y',24 *3600 *365]; |
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 would expect that this test will start to fail on March 1st, 2023. 🤓
alexandre-dauboisSep 17, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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'm struggling a bit with these tests, as months and years, of course, may have different number of days. Any advice welcome about this one!
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.
Is the variable length of the limit desired? So far, the rate limiter worked with fixed lengths, IIRC. We would change that now.
alexandre-dauboisSep 17, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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'm wondering if it's worth testing this method doing a simple timestamp operation. What I mean is if it changes,FixedWindowLimiter tests and similar will break, as I updatedFixedWindowLimiterTest with long intervals too.
The lack of tests onTimeUtil currently makes me wonder even more.
| --- | ||
| * The component is not experimental anymore | ||
| * Add support of long intervals (months and years) |
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.
| * Add supportof long intervals (months and years) | |
| * Add supportfor long intervals (months and years) |
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.
Of course, fixed. Thanks, Oskar!
a1d2d61 to342164eComparefabpot commentedOct 29, 2021
Thank you@alexandre-daubois. |
Uh oh!
There was an error while loading.Please reload this page.
As mentioned in the issue and as found on Stackoverflow, we may use timestamps instead of converting
DateIntervalproperties to seconds.