Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix race condition in BatcherImpl flush (#1200)
* fix: Fix race condition in BatcherImpl flush Currently the following race condition exists: T1 - awaitAllOutstandingBatches checks that numOfOutstandingBatches > 0 T2 - onBatchCompletion decrements numOfOutstandingBatches T2 - flushLock.notifyAll() T1 - flushLock.wait() so T1 will wait indefinitely The fix is quite simple: make sure that the there batches to wait for after acquiring the lock * add test
- Loading branch information
Showing with 71 additions and 0 deletions.