-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 4.3.0
-
Component/s: Connection Management
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.