[SERVER-57253] Make it safe to launch threads from the constructors of decorations on ServiceContext Created: 27/May/21 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | sa-remove-fv-backlog-22 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Service Arch
|
||||
| Participants: | |||||
| Description |
|
Launching threads in ServiceContext decoration constructors and constructor actions is currently prohibited, but it doesn't have to be. By doing the work to make the code in this range thread safe, and moving the construction of decorations to the end of the ServiceContext constructor, we could allow decorations to create threads and access the ServiceContext they decorate. This would simplify a lot of subsystem setup code that currently has to lazily initialize thread pools on first use or in a startup routing invoked directly from mongod or mongos's main functions. |