[GODRIVER-578] Panic in cursor Close deadlocks Created: 20/Sep/18  Updated: 28/Oct/23  Resolved: 02/Nov/18

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 0.0.18

Type: Bug Priority: Major - P3
Reporter: David Golden Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: beta
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Passing a nil context to cursor.Close triggered a panic that then caused the application to hang. The Go tracer identified the following stack trace:

noformat
runtime.selectgo:392
github.com/mongodb/mongo-go-driver/vendor/golang.org/x/sync/semaphore.(*Weighted).Acquire:64
github.com/mongodb/mongo-go-driver/core/connection.(*pool).Disconnect:131
github.com/mongodb/mongo-go-driver/core/topology.(*Server).Disconnect:164
github.com/mongodb/mongo-go-driver/core/topology.(*Topology).removeServer:422
github.com/mongodb/mongo-go-driver/core/topology.(*Topology).Disconnect:155
github.com/mongodb/mongo-go-driver/mongo.(*Client).Disconnect:109
github.com/mongodb/mongo-tools-common/db.(*SessionProvider).Close:124
runtime.call32:573
runtime.gopanic:502
runtime.panicmem:63
runtime.sigpanic:388
github.com/mongodb/mongo-go-driver/core/connection.(*pool).get:176
github.com/mongodb/mongo-go-driver/core/connection.(*pool).Get:163
github.com/mongodb/mongo-go-driver/core/topology.(*Server).Connection:180
github.com/mongodb/mongo-go-driver/core/topology.(*cursor).Close:148
github.com/mongodb/mongo-tools/mongodump.(*MongoDump).CreateIntentsForDatabase:379
github.com/mongodb/mongo-tools/mongodump.(*MongoDump).CreateAllIntents:416
github.com/mongodb/mongo-tools/mongodump.(*MongoDump).Dump:263
main.main:92
noformat



 Comments   
Comment by Githook User [ 02/Nov/18 ]

Author:

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

Message: Default to context.Background in cursor.Close

GODRIVER-578

Change-Id: Iaa45873ff5eeb896502e5657ce314124da5ec6e5
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/788107e1949331ec656c1a8bb8ab6fe295508657

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