[CSHARP-2502] Change stream spec should be more explicit about how to kill the cursor before resuming Created: 05/Feb/19  Updated: 27/Oct/23  Resolved: 11/Feb/19

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Ian Whalen (Inactive) Assignee: Robert Stam
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-598 Change stream spec should be more exp... Closed

 Description   

See DRIVERS-598 for details.



 Comments   
Comment by Robert Stam [ 11/Feb/19 ]

In the C# driver the kill cursors command is sent as part of calling Dispose on the old cursor:

https://github.com/mongodb/mongo-csharp-driver/blob/v2.7.x/src/MongoDB.Driver.Core/Core/Operations/ChangeStreamCursor.cs#L94

As per .NET guidelines Dispose methods should NOT throw exceptions, so therefore any errors when calling KillCursors should be ignored.

This can be verified by examining this line of code:

https://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver.Core/Core/Operations/AsyncCursor.cs#L408

(linking to code from master because this is a change that has not yet shipped).

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