[SERVER-50604] ServerStatus needs initializer[s]. Created: 28/Aug/20  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) 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:
Depends
Related
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-10-04
Participants:
Linked BF Score: 30
Story Points: 2

 Description   

The ServerStatus command implementation has two variables here that are evaluated upon every run. _started is const so it cannot race but it is set pre-main which isn't quite right. _runCalled however is called upon first run(). Unfortunately, run() has no synchronization guarantees.

So we should replace _runCalled with _sectionsLocked, make a MONGO_INITIALIZER to set _sectionsLocked, and use invariant instead of verify here.

It's probably also worthwhile to move _started to be a ServiceContext Decoration+ConstructorAction. It is currently records a time before main(). Instead, it should record a time after main() after the ServiceContext used with ServerStatus is constructed.

 

Acceptance criteria:

Update the ServerStatus command so that updating the _runCalled data member is not racy.


Generated at Thu Feb 08 05:23:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.