-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove a possible deadlock on polling queue fill (#462)
* Remove a possible deadlock on polling queue fill Adding new items to the receive queue for the PrefetchRecordsPublisher when at capacity would deadlock retrievals as it was already holding a lock on this. The method addArrivedRecordsInput did not need to be synchronized on this as it didn't change any of the protected state (requestedResponses). There is a call to drainQueueForRequests immediately after the addArrivedRecordsInput that will ensure newly arrived data is dispatched. This fixes #448 * Small fix on the reasoning comment * Adjust the test to act more like the ShardConsumer The ShardConsuemr, which is the principal user of the PrefetchRecordsPublisher, uses RxJava to consume from publisher. This test uses RxJava to consume, and notifies the test thread once MAX_ITEMS * 3 have been received. This ensures that we cycle through the queue at least 3 times. * Removed the upper limit on the retrievals The way RxJava's request management makes it possible that more requests than we might expect can happen.
- Loading branch information
1 parent
b83a32b
commit f52f255
Showing
2 changed files
with
95 additions
and
5 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