[GODRIVER-2730] Fix possible deadlock when recovering panic in "Server.update" Created: 10/Jan/23 Updated: 28/Oct/23 Resolved: 13/Mar/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.12.0, 1.11.3 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Matt Dale | Assignee: | Qingyang Hu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
The server heartbeat goroutine (Server.update) uses a "defer recover" block that catches any panics that happen during heartbeats. That "defer recover" block uses a blocking channel receive to prevent the Server.update call from exiting until Server.Disconnect is called (see code here). If a panic does happen, that blocking channel receive can result in a deadlock when the application is shutting down. Remove the channel receive to prevent a deadlock while shutting down. Definition of done:
|
| Comments |
| Comment by Githook User [ 17/Mar/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |
| Comment by Githook User [ 13/Mar/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |