-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Fix rate limiting for logger, increase refill rate #39360
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
Fix rate limiting for logger, increase refill rate #39360
Conversation
Signed-off-by: Ethan Mosbaugh <ethan@replicated.com>
@dperny @kolyshkin ptal |
Thank you for fixing this. I did not have a good first-glance understanding of the rate limiter and what was wrong with the implementation, and I had not yet prioritized fixing it. I appreciate you taking the time to understand and fix the problem, and including a good comment update to boot LGTM. Test seem to be failing for unrelated reasons and can be rerun. |
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.
SGTM
ping @cpuguy83 @kolyshkin PTAL
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.
LGTM
Sorry to bump an old PR, but is this planned for release sometime soon? I believe I'm experiencing this issue on a recently built cluster (19.03.7). |
This could be backported to 19.03, I think. |
Backport is here: #40628 |
EDIT: nope, still happening. #39360 (comment) |
Experiencing this on Docker 19.03.06, and after upgrading to 19.03.12 it remains. Temp fix is just getting logs individually from each container. |
Same, it seemed better at first but then I noticed service logs hanging again. I had documented my experience with logs still hanging in the original closed issue: #38640 (comment) |
Signed-off-by: Ethan Mosbaugh ethan@replicated.com
- What I did
fixes #38640
- How I did it
The rate limiter will get refilled at a rate of 1 token per second. My understanding of the code it is intended to get refilled at a rate of 10M / second.
moby/vendor/golang.org/x/time/rate/rate.go
Lines 31 to 37 in 39c8e88
- How to verify it
$ docker service create --name lotsologs --restart-condition on-failure -d debian:stretch-slim bash -c "for i in \$(seq 1 60000); do cat /dev/urandom | tr -dc 'a-zA-Z0-9 ' | fold -w 256 | head -n 1; done" y0uhc0ulyxcqe2r5gehfzeiks
wait a while for the logs to fill up
- Description for the changelog
Fixed an issue that caused requests for docker swarm service and task logs to hang indefinitely for logs with size greater than 10 MB.
- A picture of a cute animal (not mandatory but encouraged)