Fix rate limiting for logger, increase refill rate#39360
Fix rate limiting for logger, increase refill rate#39360thaJeztah merged 1 commit intomoby:masterfrom
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. |
thaJeztah
left a comment
There was a problem hiding this comment.
SGTM
ping @cpuguy83 @kolyshkin PTAL
|
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" y0uhc0ulyxcqe2r5gehfzeikswait 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)