[JAVA-2549] AsyncBatchCursor when batchSize is 1 terminates prematurely Created: 10/Jul/17 Updated: 27/Oct/23 Resolved: 10/Jul/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API, Async |
| Affects Version/s: | 3.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Luciano Joublanc [X] | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | find | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
It appears that when using the async Java driver, if you create an AsyncBatchCursor via
specifically using batchSize = 1, the cursor closes after a single call to next(), even when there are multiple elements to return. i.e. the second call to next() results in null. This behaviour is consistent. Changing the batchSize to > 1 resolves the problem. I'd be grateful if somebody can confirm they can reproduce this. This looks like something really simple to have been overlooked in testing, so I want to ensure I'm not going nuts! |
| Comments |
| Comment by Luciano Joublanc [X] [ 10/Jul/17 ] |
|
Hi Ross, thanks for your quick feedback. Consider updating / adding a hint in the javadoc? _Returns: |
| Comment by Ross Lawley [ 10/Jul/17 ] |
|
Hi lJoublanc, Thanks for the ticket, theres no special handling of batchSize in the driver. However, there is in the server:
The result is the with a batchSize of 1, the cursor is automatically closed by the server. I appreciate that it may be surprising, but it is expected behaviour. Ross |