[GODRIVER-1663] Context pinned by connection.connect Created: 22/Jun/20 Updated: 28/Oct/23 Resolved: 02/Jul/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.3.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Kriti Ravindran (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
The connection.connect function wraps the supplied context using context.WithCancel and stores the returned cancellation function so we can abort connection establishment. We need to ensure we call that function in a defer after connect finishes and also set it to nil because the cancellation function holds a reference to the context, which pins all of the memory that the context has stored. This will require a mutex for syncrhonization because the cancellation function is accessed by both the connect and closeConnectContext functions. |
| Comments |
| Comment by Githook User [ 02/Jul/20 ] |
|
Author: {'name': 'Kriti Ravindran', 'email': 'kriti.ravindran@mongodb.com', 'username': 'KritiRav'}Message: |
| Comment by Githook User [ 02/Jul/20 ] |
|
Author: {'name': 'Kriti Ravindran', 'email': 'kriti.ravindran@mongodb.com', 'username': 'KritiRav'}Message: |