[GODRIVER-1411] Data race between creating a new connection and disconnecting topology Created: 16/Nov/19  Updated: 28/Oct/23  Resolved: 29/Jan/20

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

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

Attachments: HTML File stacktrace    

 Description   

eric.daniels pointed out a data race that I've attached to this ticket. We should be able to get around this by storing c.nc as an atomic value and loading it atomically in pool.closeConnection. Eric pointed out that we might be able to write a test for this by having one goroutine open a connection and another goroutine close it.

stacktrace

 



 Comments   
Comment by Githook User [ 29/Jan/20 ]

Author:

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

Message: GODRIVER-1411 fix data race between connection.connect and pool.disconnect (#284)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/9bf2a79ed1a98a464036e1c6720e47bfe7fb92e0

Comment by Isabella Siu (Inactive) [ 16/Dec/19 ]

eric.daniels so I have a fix for this at https://github.com/mongodb/mongo-go-driver/pull/258, but this could hurt performance.  It changes closeConnection to wait for the connection to finish connecting, which could take a long time in certain situations.

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