[GODRIVER-1173] Add connected status to connection to avoid race conditions Created: 28/Jun/19 Updated: 28/Oct/23 Resolved: 01/Jul/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
If Disconnect is called without a deadline while a connection is still checked out, we will aggressively close connections, which involves setting the underlying net.Conn to nil. This can cause a race condition if the checked out connection is in the middle of a network read. We can fix this by adding a atomic int32 status to the connection type to test if a connection is open/closed instead of checking if c.nc == nil. |
| Comments |
| Comment by Githook User [ 03/Jul/19 ] |
|
Author: {'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}Message: Revendor driver for |
| Comment by Githook User [ 01/Jul/19 ] |
|
Author: {'name': 'Divjot Arora', 'username': 'divjotarora', 'email': 'divjot.arora@10gen.com'}Message: Add connected status to connection type. Change-Id: I324fcba31c4065091a3449930fdbf88dc6b14afc |
| Comment by Divjot Arora (Inactive) [ 28/Jun/19 ] |
|
cr: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/459840 |