-
Notifications
You must be signed in to change notification settings - Fork 97
Issue in reactive data-loader #273
Description
java-dataloader/src/main/java/org/dataloader/reactive/AbstractBatchSubscriber.java
Line 53 in e5e5bf5
| subscription.request(keys.size()); |
When the subscription happens we request the size of the keys.
Lets take an example where we batch load one key.
The implementation is buggy and the result is two rows. But the second is the one matching the actual key requesting.
Once the first result is received, the observable will wait for a signal to send more which never happens and the data loader is staying blocked.
The solution is to keep keep track of pending requests and when it reaches zero we should re-request until we eventually get to onError or onComplete.
At the same time if we manage to receive all the values that we expect prior to completing upstream we are free to cancel upstream and complete manually