[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: |
|
| 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.
|
| Comments |
| Comment by Githook User [ 29/Jan/20 ] |
|
Author: {'name': 'iwysiu', 'username': 'iwysiu', 'email': 'isabella.siu@10gen.com'}Message: |
| 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. |