[Dataflow Streaming] Reduce contention on CommitQueue - #39737
[Dataflow Streaming] Reduce contention on CommitQueue#39737arunpandianp wants to merge 1 commit into
Conversation
Replaces LinkedBlockingQueue with a ConcurrentLinkedQueue and a Semaphore. The harness threads don't block on the queue anymore. Improves the internal reshuffle benchmark run time by ~10%.
|
R: @scwhittle |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
|
Is delayed visibility acceptable here? With concurrent producers, one can pause after |
|
@bvolpato Thanks, that is a good observation. Such interleaving are possible and i think it is fine, with how the queue is used today in StreamingEngineWorkCommitter and StreamingApplianceCommitter. It is true that a consumer can consume items using permits released after a different item. Generally the logic to stop consumers (or draining queue) should know and happen after all producer puts are complete. So that edge i think resolves the visibility problems here. Having said that, changing to LinkedTransferQueue might be a simpler option with similar benefits. Testing it. |
|
LinkedTransferQueue does seem like it would be simpler, so I'd prefer that. |
Replaces LinkedBlockingQueue with a ConcurrentLinkedQueue and a Semaphore. The harness threads don't block on the queue anymore.
Improves the internal reshuffle benchmark run time by ~10%.
#33578