[SERVER-52849] PrimaryOnlyService _rebuildServices accesses _scopedExecutor without locking the mutex Created: 13/Nov/20 Updated: 29/Oct/23 Resolved: 28/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Saltz (Inactive) | Assignee: | Tyler Seip (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | post-rc0, servicearch-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Backport Requested: |
v5.0
|
||||||||||||||||||||||||
| Sprint: | Service Arch 2021-04-19, Service Arch 2021-05-17, Service Arch 2021-05-31 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 144 | ||||||||||||||||||||||||
| Story Points: | 7 | ||||||||||||||||||||||||
| Description |
|
This call to _rebuildInstances accesses _scopedExecutor without holding the mutex. This is a problem because on shutdown we swap _scopedExecutor with an empty executor. So if there is a step up, and then this lambda starts running but hangs before this line, and then a shutdown happens, _rebuildInstances could be using an empty/invalid _scopedExecutor. The same could possibly happen on step up - step down - step up, but it's a bit harder to follow. I don't know if it's sufficient to just take the mutex in that callback since that might break other assumptions, so we might have to do some rearranging of things. Acceptance criteria: Ensure proper synchronization between onStepUp, onStepDown and shutdown. |
| Comments |
| Comment by Githook User [ 28/May/21 ] |
|
Author: {'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}Message: |
| Comment by Githook User [ 28/May/21 ] |
|
Author: {'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}Message: |