[GODRIVER-1323] Cleanup connection close logic Created: 26/Sep/19 Updated: 28/Oct/23 Resolved: 03/Oct/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Core API |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.2 |
| 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 | ||
| Issue Links: |
|
||||
| Description |
|
For the topology.Connection type, we release the server's semaphore in the Close and Expire methods, but only set the underlying connection to nil if there are no errors. This could lead to a semaphore being released too many times if the following happens: 1. Close is called. Semaphore is released once but there is an error putting the connection back in the pool, so the underlying connection is not set to nil. 2. Close is called again. The semaphore is released again, causing a panic. To fix this, we should move the line that sets connection to nil higher up so that it always happens and avoids a panic. |
| Comments |
| Comment by Githook User [ 03/Oct/19 ] |
|
Author: {'username': 'iwysiu', 'email': 'isabella.siu@10gen.com', 'name': 'iwysiu'}Message: |
| Comment by Githook User [ 03/Oct/19 ] |
|
Author: {'name': 'iwysiu', 'username': 'iwysiu', 'email': 'isabella.siu@10gen.com'}Message: |