arunpandianp opened a new pull request, #40593: URL: https://github.com/apache/beam/pull/40593
`KeyGroupWorkQueue` guarded a doubly-linked global queue and per-key-group queues with a single `ReentrantLock`, creating lock contention across worker and `GetWork` threads when multi-key bundles are enabled. Use `LinkedBlockingQueue` as the `BoundedQueueExecutor` work queue unconditionally, and index stealable work in `KeyGroupWorkIndex` across 64 fixed `HashMap<QueueKey, ArrayDeque<QueuedWork>>` shards synchronized per shard. An executor thread and `pollWork` coordinate on a `QueuedWork` via a single atomic state transition, clearing work and budget references immediately upon claim. Claimed entries at the head of a key-group queue are drained in amortized O(1) time during index mutations, and stale shells left in `LinkedBlockingQueue` by stolen work are purged in bulk once the queue size exceeds twice `maximumElementsOutstanding`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
