Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4260

AsyncQueryBatchCursor should not try to kill the server cursor if pinned connection is corrupted

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 4.3.0
    • Component/s: Connection Management
    • Labels:

      When working in LB mode, both QueryBatchCursor and AsyncQueryBatchCursor pin a connection and use it for both issuing getMore and killCursors command. If a network error happens while doing getMore, the driver closes the Stream underlying the pinned connection and the connection cannot be used anymore. Thus, the QueryBatchCursor/AsyncQueryBatchCursor should not even try using it. QueryBatchCursor was changed to behave as described when the LB support was implemented, but AsyncQueryBatchCursor was not.

      Note that it may be tempting to release the pinned connection and the connection source when a network error happens, but there is a specification test cursors.json: "pinned connections are not returned after an network error during getMore" that unfortunately prevents exactly this. Hopefully it will be gone in the future as a result of DRIVERS-1847.

            Unassigned Unassigned
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            0 Vote for this issue
            1 Start watching this issue