[SERVER-15365] Make serverStatus metrics safe to add during static initialization Created: 24/Sep/14 Updated: 18/Feb/15 Resolved: 24/Sep/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Matt Kangas | Assignee: | Matt Kangas |
| Resolution: | Done | Votes: | 0 |
| Labels: | community-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Server 2.7.4, Server 2.7.5, Server 2.7.6 |
| Participants: |
| Description |
|
Needed for |
| Comments |
| Comment by Andy Schwerin [ 24/Sep/14 ] |
|
It is already safe, though only a careful examination of the code shows why. The reason is, surprisingly, because it is only safe to add metrics to the metrics tree during single-threaded operation. This is because there is no mutex or other synchronization guarding it. Since it's only safe to add during single-threaded operation, the check-and-instantiate behavior is OK. |