-
Notifications
You must be signed in to change notification settings - Fork 125
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
Bug 1676712: Reduce throttle backoff time to 1s and fixes it for python and swift #1315
Conversation
…on and swift Fixes regression introduced by PR mozilla#1240 : Python and Swift "sleep" functions are expecting "seconds" and not ms.
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.
Hey @fviard , thanks for finding and fixing this issue. The intended throttle backoff for is 60s though. Glean's internal throttle time is 60s, which means the binding will still need to wait 60s to get next pings even if they sleep for less than that. Would you mind changing it?
I understand this probably does not solve the issue you describe on the bug about the tests hanging for too long. They will still hang for at least 60s. We have a bug open to allow for customizing the throttling interval, which would allow for you to disable throttling completely for tests. See Bug 1647630.
Hi @brizental, But at least, you can react immediately when the time is arrived. Btw, If you think about it, if your rate limiter is 60s and you plan to sleep for 60s when you receive a WAIT, then:
|
Yes, you are right about this. But glean-core only throttles in case there are next tasks, if there are none it will return DONE.
If the binding asks for a new task and gets a WAIT response 3 times in a row, it will then get a DONE response. So, if we go ahead with your suggestion of the binding asking every 1s, we make obsolete the rate limiting applied by glean-core, because anytime the limit is reached the binding will ask three times, get a DONE response and shut down the upload worker.
Regarding this issue, we have also opened a bug to implement your suggestion of a sliding window algorithm, where glean-core tells the binding to wait exactly the amount of time it should until the next rate limit interval instead of defaulting to 60s. See Bug 1676853.
This feature has not been implemented yet, so it couldn't have been the issue we didn't notice. I am guessing we didn't notice just because we do not reach the rate limit on our unit tests. |
Hi, sorry for the delay of my reply. Regarding the sliding window, it is good, but please don't forget that one of the issue of the sleep is also to have the process interruptible at any time. |
Fixes regression introduced by PR #1240 :
Python and Swift "sleep" functions are expecting "seconds" and not ms.