[GODRIVER-1238] Closing a change stream without reading it returns an error Created: 19/Aug/19  Updated: 28/Oct/23  Resolved: 22/Aug/19

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: 1.1.0
Fix Version/s: 1.1.1

Type: Bug Priority: Major - P3
Reporter: Pierre Durand Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Go 1.13beta1
MongoDB 4.2
Go MongoDB driver 1.1.0


Attachments: File csclose.go    
Backwards Compatibility: Fully Compatible

 Description   

See the attached code.

If you close a change stream without reading it, it returns the error "ended session was used".

It happens only since v1.1.0. I can't reproduce it with v1.0.4



 Comments   
Comment by Githook User [ 08/Oct/19 ]

Author:

{'username': 'divjotarora', 'email': 'divjot.arora@10gen.com', 'name': 'Divjot Arora'}

Message: Support looser extended JSON datetime format. (#187)

GODRIVER-1238
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c286318774af5547812cbcaa91ab2ffe60910ba0

Comment by Githook User [ 22/Aug/19 ]

Author:

{'username': 'iwysiu', 'email': 'isabella.siu@10gen.com', 'name': 'iwysiu'}

Message: GODRIVER-1238 Closing a change stream without reading it returns an error

Change-Id: Ic366961626eb469d39d3bc10b9675d8e3331274e
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/bf97abed17b6324ec5a43675867a5ff1bf0c2101

Comment by Isabella Siu (Inactive) [ 21/Aug/19 ]

code review url: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/465962

Comment by Kristofer Brandow (Inactive) [ 19/Aug/19 ]

Hi pierrre,

Thanks for reporting this, it appears that we are closing the implicit session that we are about to use to close the cursor. I'll schedule this to be fixed.

--Kris

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