[19.03] Fix rate limiting for logger, increase refill rate#40628
Merged
thaJeztah merged 1 commit intomoby:19.03from Apr 2, 2020
Merged
[19.03] Fix rate limiting for logger, increase refill rate#40628thaJeztah merged 1 commit intomoby:19.03from
thaJeztah merged 1 commit intomoby:19.03from
Conversation
Signed-off-by: Ethan Mosbaugh <ethan@replicated.com> (cherry picked from commit 50c6a5f) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
tonistiigi
approved these changes
Apr 2, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports #39360 to 19.03
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)