AsyncBatchCursor when batchSize is 1 terminates prematurely

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.4.2
    • Component/s: API, Async
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It appears that when using the async Java driver, if you create an AsyncBatchCursor via

      cursor = collection.find(bson).batchSize(1).batchCursor(callback)
      

      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!

              Assignee:
              Ross Lawley
              Reporter:
              Luciano Joublanc [X]
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: