Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
Platform 9 (09/18/15), Platform A (10/09/15)
Description
ExportedServerParameter does not protect the underlying templated variable from concurrent access.
The following construct is hence not safe if maxConsecutiveFailedChecks is ever read without holding a lock preventing a setParameter call:
ExportedServerParameter<int> MaxConsecutiveFailedChecksSetting(
|
ServerParameterSet::getGlobal(),
|
"replMonitorMaxFailedChecks",
|
&ReplicaSetMonitor::maxConsecutiveFailedChecks,
|
false, // allowedToChangeAtStartup
|
true); // allowedToChangeAtRuntime
|
We could either:
1) Prevent ExportedServerParameter to be configured with allowedToChangeAtRuntime = true, and make implementers having to inherit from ServerParameter directly, or
2) Use a mutex in ExportedServerParameter or use atomics for the template specializations where that make sense.
Regardless we should audit the existing uses of ExportedServerParameter.
Attachments
Issue Links
- related to
-
SERVER-20441 ReplIndexPrefetch Server Parameter is not thread-safe
-
- Closed
-