[Merged by Bors] - feat(producer): added blocking if the batch queue is full#2562
Closed
galibey wants to merge 7 commits intofluvio-community:masterfrom
galibey:feat/2512-throughput-control-condvar
Closed
[Merged by Bors] - feat(producer): added blocking if the batch queue is full#2562galibey wants to merge 7 commits intofluvio-community:masterfrom galibey:feat/2512-throughput-control-condvar
galibey wants to merge 7 commits intofluvio-community:masterfrom
galibey:feat/2512-throughput-control-condvar
Conversation
sehz
suggested changes
Aug 16, 2022
sehz
left a comment
There was a problem hiding this comment.
This approach seems to be reasonable approach with minimum complexity.
Couple of changes I would like to see:
- Replace
CondVarwithEventListenerwhich we use lot in the code base. This should remove need to depend on entireasync-std - Unit Test queue which I believe should be achievable by abstracting out
Mutex<VedDeque...
|
|
||
| pub(crate) type BatchHandler = ( | ||
| Arc<BatchEvents>, | ||
| Arc<(Mutex<VecDeque<ProducerBatch>>, Condvar)>, |
There was a problem hiding this comment.
Probably should abstract out:
Arc<(Mutex<VecDeque<ProducerBatch>>, Condvar)>
as NewType so can independently unit test and easy to reason about
Collaborator
There was a problem hiding this comment.
new internal type created for that
This reverts commit 3b32eb0.
Collaborator
|
Feedback addressed, I also tried hourly tests with these changes to ensure that it is working as expected |
sehz
approved these changes
Aug 19, 2022
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Aug 19, 2022
Added the batch queue size control using `Condvar`. If the configured queue size is reached, we block pushing new records until there is enough space for a new batch. During the flush, we notify all waiting threads that they can progress. Fixed #2512 Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
|
hopefully this will improve hourly test stability |
|
Pull request successfully merged into master. Build succeeded: |
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.
Added the batch queue size control using
Condvar.If the configured queue size is reached, we block pushing new records until there is enough space for a new batch. During the flush, we notify all waiting threads that they can progress.
Fixed #2512