-
Notifications
You must be signed in to change notification settings - Fork 26
refactor(ticker): Don't reset manually #1058
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
Conversation
|
What is this fixing? |
|
It seems to me like the other code used to handle a 0 timeout, but this doesn't (I'm not sure what ticker's behavior is if it's passed 0). We don't have tests for that case in these two batch writers right now, but I think a better fix here would be to add a test for a 0 timeout? |
|
Not supporting a zero/disabled batchtimeout doesn't sit well with the file destinations (with NoRotate or path patterns without UUID). |
|
@hermanschaaf @disq // Tick is a convenience wrapper for NewTicker providing access to the ticking
// channel only. While Tick is useful for clients that have no need to shut down
// the Ticker, be aware that without a way to shut it down the underlying
// Ticker cannot be recovered by the garbage collector; it "leaks".
// Unlike NewTicker, Tick will return nil if d <= 0.
func Tick(d Duration) <-chan Time {
if d <= 0 {
return nil
}
return NewTicker(d).C
} |
disq
left a comment
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.
Missing the fix for streamingbatchwriter :)
|
Isn't the leak mentioned in the comment of |
I think it is if we're going to have long running writers. |
|
Fixed leak in e63bc5e |
|
Same ticker will be used for all writers, maybe move this to the upper |
Follow-up for #1056