[GODRIVER-1345] Disconnect takes a long time on paused Atlas cluster Created: 16/Oct/19  Updated: 28/Oct/23  Resolved: 18/Oct/19

Status: Closed
Project: Go Driver
Component/s: Connections
Affects Version/s: None
Fix Version/s: 1.1.3

Type: Bug Priority: Major - P3
Reporter: Eric Daniels (Inactive) Assignee: Eric Daniels (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File repro.tgz    
Issue Links:
Related

 Description   

I think two things are happening
1. We heartbeat and connect/dial with a background context which takes a long time
on a paused cluster which doesn't refuse connections immediately.
2. We only stop doing this based on <-done in a 50/50 chance select two times that
comes from a disconnect so I think it's very possible to get unlucky for a long time
over many repeated requests.
Note: uncomment the code in connection.go that is a single select statement to see
how disconnect speeds up.

Attached repro



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

Author:

{'username': 'edaniels', 'email': 'eric@erdaniels.com', 'name': 'Eric Daniels'}

Message: GODRIVER-1345 - Respect context.Context cancellation in Disconnect (#199)
Branch: release/1.1
https://github.com/mongodb/mongo-go-driver/commit/cfbb60075ddbcd74761e14f4ce2fc55452a03ff1

Comment by Githook User [ 18/Oct/19 ]

Author:

{'name': 'Eric Daniels', 'username': 'edaniels', 'email': 'eric@erdaniels.com'}

Message: GODRIVER-1345 - Respect context.Context cancellation in Disconnect (#199)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/ebcb636dccf8c83c25835ce5c3b7c00f70eb7df4

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