[SERVER-79801] Streams: fix deadlock in stopStreamProcessor call when there is a concurrent background error Created: 07/Aug/23 Updated: 10/Dec/23 Resolved: 15/Sep/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Matthew Normyle | Assignee: | Matthew Normyle |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | init-337-m2-1, init-337-m3 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Atlas Streams
|
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Sprint 31 |
| Participants: |
| Description |
|
A deadlock can occur when a client calls stop while the Executor thread is handling an error and shutting down. Client thread calling stop: Has the StreamManager::_mutex. Calling into executor->stop. In Executor::stop, waiting on _executorThread.join(). Executor thread: stuck in StreamManager::onExecutorError, can't acquire the mutex.
|
| Comments |
| Comment by Sandeep Dhoot [ 29/Aug/23 ] |
|
In addition to the deadlock issue, we also want to avoid holding `StreamManager::_mutex` while calling `executor->stop` as it could take a long time. |