GODRIVER-4243Blocked

Change stream leaks the server cursor when Next's context expires or is canceled

When the context passed to {{ChangeStream.Next}} expires, the driver tries to resume using that expired context. The {{killCursors}} for the old cursor fails without being sent, but {{BatchCursor.Close}} sets the cursor ID to 0 anyway. A later {{{}ChangeStream.Close{}}}, even with a live context, therefore sends nothing. The server cursor stays open until the idle cursor reaper removes it. Applications that bound each {{Next}} call with a timeout leak one server cursor per timeout. On deploym

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.