-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rewrite processQueue for better batching #719
Conversation
I also support renaming the timeout to |
I would like to see the call to
|
PTAL. I've left BatchTimeout for separate PR since it is likely to affect several packages. There multiple commits to ease review. |
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.
In my prior review I suggested using a context for safe shutdown, not a wait group. These comments would apply, if you take the suggestion.
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 believe there is still a problem that can be fixed by adding one more pair of Add(1)
and Done()
calls.
This is very close, and I appreciate your patience! |
PTAL - I've went with read-and-throw-away goroutine as you suggested previously. Perhaps golang/go#21985 is not such a bad idea after all. |
I noticed near the end of golang/go#21985
which is similar to the idea in #719 (comment). However I'm inclined to accept this as-is. I may file an issue to remove |
I believe that comment suggests to use context.Context instead of |
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.
Thanks for tackling this!
Previous discussion in #702
The tests are failing and I am not sure what to do about them. As I understand they were working by accident or buggy behavior in previous implementation. E.g.
fails with
This result depends on call/scheduling order (the fact that consuming is stopped for ScheduledDelayMillis) and BatchSpanProcessor does not provide such guarantees in real/production environment. So I would suggest to remove these assertions instead of just updating the numbers.
I would also rename ScheduledDelayMillis -> ScheduledDelay -> BatchTimeout.