Replaced ClusterMetricSink's cluster name with an atomic.Value.#9252
Merged
Conversation
added 2 commits
June 17, 2020 15:31
This should permit go-race tests to pass which seal and unseal the core.
Contributor
Author
|
Another failure, in an odd place, this is @sgmiller's new code: Does metricSink get modified by seal or unseal? |
Contributor
Author
|
Ah, that test swaps in a different metricSink after the core is unsealed. Need to think about how to do this in a race-free manner. |
calvn
reviewed
Jun 18, 2020
| @@ -59,17 +63,30 @@ func (m *ClusterMetricSink) MeasureSinceWithLabels(key []string, start time.Time | |||
| func BlackholeSink() *ClusterMetricSink { | |||
| sink, _ := metrics.New(metrics.DefaultConfig(""), | |||
Contributor
There was a problem hiding this comment.
Could we do return NewClusterMetricSink("", sink) over here?
Contributor
Author
There was a problem hiding this comment.
Yeah, good point, I added the second factory later and then forgot to refactor this one. I'll fix that and commit.
Contributor
Author
There was a problem hiding this comment.
On second thought, I'll commit now and fix later.
calvn
approved these changes
Jun 18, 2020
catsby
added a commit
that referenced
this pull request
Jun 19, 2020
* master: (31 commits) changelog++ changelog++ Ui/replication status discoverability (#8705) Update CHANGELOG.md Counter that increments on every secret engine lease creation. (#9244) Add password_policy field to Azure docs (#9249) Replaced ClusterMetricSink's cluster name with an atomic.Value. (#9252) Fix database creds rotation panic for nil resp (#9258) changelog++ changelog++ Move sdk/helper/random -> helper/random (#9226) UI: Disallow kv2 with too large 'max versions' value (#9242) Allow mTLS for mysql secrets engine (#9181) docs: add sample revocation for mongodb (#9245) Add new Telemetry config options (#9238) Add a simple sealed gauge, updated when seal status changes (#9177) Test Shamir-to-Transit and Transit-to-Shamir Seal Migration for post-1.4 Vault. (#9214) Configure metrics wrapper with the "global" object, not just the fanout. (#9099) changelog++ Add backend type to audit logs (#9167) ...
andaley
pushed a commit
that referenced
this pull request
Jul 17, 2020
* Replaced ClusterMetricSink's cluster name with an atomic.Value. This should permit go-race tests to pass which seal and unseal the core. * Replace metric sink before unseal to avoid data races.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced ClusterMetricSink's cluster name with an atomic.Value. This should permit go-race tests to pass which seal and unseal the core.
Alternatives considered:
The approach here seems like the least heavyweight solution to the potential race.