[SERVER-47166] Self-deadlock when cancelling networking sessions Created: 27/Mar/20 Updated: 29/Oct/23 Resolved: 16/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency, Networking |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Benjamin Caimano (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Service arch 2020-04-20 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 32 | ||||||||||||
| Description |
|
cancelSession erases the TransportSession under the Baton's mutex. If that session has an outstanding Promise, however, it will try to break that promise, which in turn schedules the corresponding Future to run (and resolve with a BrokenPromise error). But scheduling the Future to run requires locking the Baton's mutex. This results in deadlock. Instead of destroying the TransportSession under the Baton's mutex, we should move the TransportSession out of the Baton's _sessions map under the mutex, the release the mutex before actually destroying the TransportSession. |
| Comments |
| Comment by Githook User [ 23/Apr/20 ] |
|
Author: {'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}Message: |
| Comment by Githook User [ 16/Apr/20 ] |
|
Author: {'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}Message: |