[CDRIVER-3474] mongoc_cursor_destroy need not send killCursors after a CursorNotFound error Created: 03/Jan/20  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If the cursor iteration previously failed with a CursorNotFound(43) error, there should be no need to issue a killCursors command when destroying the mongoc_cursor_t. In fact, doing so could inadvertently kill a different cursor if the ID were to be reused between the application encountering a CursorNotFound error during iteration and ultimately calling mongoc_cursor_destroy.

This is something I noticed while implementing some contrived tests for PHPC-1274, which involved creating a cursor in a parent process, iterating it to completion in a forked child process, and then allowing the parent to destroy its cursor after waiting on the child to terminate.


Generated at Wed Feb 07 21:18:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.