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.
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 goroutine leak: make flushDaemon stoppable #293
Fix goroutine leak: make flushDaemon stoppable #293
Changes from 3 commits
0d5c8b7
7ad18de
b6757a5
31a05ea
ec08484
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
this adds a circular dependency... utils already depends on klog, we should avoid making klog also depend on utils
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.
I think the test is useful enough that we should not remove it and instead carry a copy of the clock code -> #310
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.
Should this be verifying something? What happens if there was a bug and flush-daemon did not call the func properly, what would this test report?
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.
The statement verifies that flush was called and let's the test wait until the flush execution finished. If the function isn't called, the test will time out. If I don't wait for the function here, the
testClock.Step()
statements will be all executed directly after each other, without flushDaemon having time to flush in between, so the flushDaemon would only enter thecase <-ticker.C()
once, regardless of how many steps the clock does.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.
What I meant is maybe we should control the timeout and produce an error ourselves. The default is something like 10 minutes, right? It seems like we could wrap these reads in a timeout of 10 seconds and produce a better error.