[JAVA-1856] DBCursor can redundantly kill a cursor in its finalizer Created: 10/Jun/15  Updated: 07/Oct/15  Resolved: 11/Jun/15

Status: Closed
Project: Java Driver
Component/s: Query Operations
Affects Version/s: 3.0.2
Fix Version/s: 3.1.0

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If the server returns a cursorId but the driver exhausts it and kills it, and the user does not close the DBCursor, the finalizer will redundantly kill the cursor.



 Comments   
Comment by Jeffrey Yemin [ 07/Oct/15 ]

Released in 3.1.0

Comment by Githook User [ 11/Jun/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Updated specification of MongoCursor to indicate that getServerCursor can be null if no cursor was created or if its been exhausted or kill.
Changed QueryBatchCursor implementation of getServerCursor to return null if it's been killed, whereas before it returned the value of the killed cursor.
By returning null in this case, DBCursor no longer redundantly kills a cursor in its finalizer.

JAVA-1856
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/d5697d40c7bd123ef4942349e2ff9662cff06220

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