Repository navigation
Copy the stored broker metadata before building the usage report - #5972
Open
johnsimons wants to merge 1 commit into
Open
johnsimons wants to merge 1 commit into
johnsimons wants to merge 1 commit into
Conversation
…ctionary EnvironmentData referenced the same dictionary instance returned by the broker metadata store, so later mutations of the report data could leak back into persisted state. Assign a new dictionary when building the report and add a test asserting stored broker metadata stays unchanged after generating a report.
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.
Should_count_the_choices_made_in_servicepulse_without_revealing_themfails intermittently on Linux-SqlServer (runs 37422880064, 37610293714 and 37859193494). Each failure reported values that belong to the other test inWhen_reporting_the_environment. Two runs had the heartbeat keys wrong (Heartbeats.TrackInstancesDefaultEnabled,Heartbeats.TrackInstancesOverrides0,Heartbeats.MonitoredInstances0). The third hadRecoverability.RedirectsandLicensing.ReportMasksat 0 instead.Cause
ThroughputCollector.GenerateThroughputReportusesbrokerMetaData.Datafrom the licensing store as the report'sEnvironmentDataand writes every report key into it. When no broker metadata is stored, as with the Learning transport, the RavenDB and EF Core stores return a shared static default, so every report in the process writes into the same dictionary. The acceptance tests run in parallel in one process. When both licensing tests build a report at the same time, one report can be signed with values the other wrote, and two concurrent writes can corrupt the dictionary.HeartbeatEndpointSettingsSyncHostedServicewas the first suspect because it upserts endpoint settings. It never ran during the failing tests: they finish in 2 to 3 seconds and the service waits 20 seconds before its first sync. It also cannot change redirects or report masks.Change
The report copies
brokerMetaData.Datainto a new dictionary before adding its own keys. New testShould_leave_the_stored_broker_metadata_unchanged.#5965 carries the same fix under "Also fixed". This PR lets it reach master on its own.
Testing
Particular.LicensingComponent.UnitTests: 90/90.When_reporting_the_environment: 10 runs on SQL Server and 10 on PostgreSQL, all green.ServiceControl.AcceptanceTestsfiltered toLicensing: 6/6 on RavenDB, SQL Server and PostgreSQL.