This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
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
1 parent
0976e20
commit c6308c9
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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