[GODRIVER-1017] Find method doesn't defer a session close. Created: 03/May/19  Updated: 07/May/19  Resolved: 07/May/19

Status: Closed
Project: Go Driver
Component/s: Error Handling
Affects Version/s: 1.0.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Sam Lotti Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Implicit session is not defer closed in the Find method:

Find.go 

line 66

 

defer cmd.Session.EndSession()

There are various return points within the method.  Will not return the session,

There is a explicitly coded close at the end.

if err != nil

{ closeImplicitSession(cmd.Session) return nil, err }

 



 Comments   
Comment by Divjot Arora (Inactive) [ 07/May/19 ]

samlotti We should be closing implicit sessions in the case of an error when appending the options (explicit sessions are kept open because the cursor uses them). However, we're in the process of removing all of the code in the driverlegacy package as part of GODRIVER-617 so we will not be fixing this in driverleagcy and will instead incorporate this into the new driver package.

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