[GODRIVER-1096] When limit is set with a BatchCursor connected to a legacy server, a connection is leaked Created: 29/May/19  Updated: 28/Oct/23  Resolved: 10/Jun/19

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.0.4

Type: Bug Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Run Tian Yu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes GODRIVER-987 Pool exhausts with MongoDB v3.0.4 Closed
Backwards Compatibility: Fully Compatible

 Description   

In the legacyGetMore method on driverlegacy.BatchCursor, when we reach the limit set by the user we fail to close the connection we opened. This can be fixed by moving the code that checks the limit before we retrieve a connection from the BatchCursor's server.

Since driverlegacy will be removed soon (in the master branch), this fix should only be done on the release/1.0 branch.



 Comments   
Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Connie Yu', 'email': 'connie.yu@10gen.com', 'username': 'connieyu'}

Message: Close connection when limit reached in legacyGetMore of driverlegacy.BatchCursor

GODRIVER-1096

Change-Id: Ifd48f555c9850db28c2de3010db908a7e7a5b652
Branch: release/1.0
https://github.com/mongodb/mongo-go-driver/commit/37f77209e9459add6e0e8a13a071c44777e88d6f

Generated at Thu Feb 08 08:35:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.