[19.03 backport] Use condition variable to wake stats collector.#40549
Merged
Conversation
Before the collection goroutine wakes up every 1 second (as configured). This sleep interval is in case there are no stats to collect we don't end up in a tight loop. Instead use a condition variable to signal that a collection is needed. This prevents us from waking the goroutine needlessly when there is no one looking for stats. For now I've kept the sleep just moved it to the end of the loop, which gives some space between collections. Signed-off-by: Brian Goff <[email protected]> (cherry picked from commit e75e6b0) Signed-off-by: Brian Goff <[email protected]>
cpuguy83
marked this pull request as ready for review
February 21, 2020 05:27
AkihiroSuda
approved these changes
Feb 21, 2020
tonistiigi
approved these changes
Feb 21, 2020
Member
|
Windows is failing is related to #40525 (comment)
I'll backport #40506 as a temporary workaround |
Member
|
Opened #40551 |
thaJeztah
approved these changes
Feb 21, 2020
thaJeztah
left a comment
Member
There was a problem hiding this comment.
LGTM
kicked CI as the Windows fix was merged, but possibly this needs a rebase to get the fix in
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.
Backport of #40481
Before the collection goroutine wakes up every 1 second (as configured).
This sleep interval is in case there are no stats to collect we don't
end up in a tight loop.
Instead use a condition variable to signal that a collection is needed.
This prevents us from waking the goroutine needlessly when there is no
one looking for stats.
For now I've kept the sleep just moved it to the end of the loop, which
gives some space between collections.
Signed-off-by: Brian Goff [email protected]
(cherry picked from commit e75e6b0)
Signed-off-by: Brian Goff [email protected]
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)