Skip to content

[-] resolve race conditions in YAML file operations, fixes #1198#1209

Merged
pashagolub merged 1 commit intomasterfrom
1198-fix-yaml-race-conditions
Feb 17, 2026
Merged

[-] resolve race conditions in YAML file operations, fixes #1198#1209
pashagolub merged 1 commit intomasterfrom
1198-fix-yaml-race-conditions

Conversation

@pashagolub
Copy link
Collaborator

Fixes race conditions in YAML-based metrics and sources I/O by adding an embedded sync.Mutex to serialize read–modify–write cycles so concurrent updates are not lost. Public methods now lock and call unlocked internal helpers (getMetrics/getSources, writeMetrics/writeSources), and new concurrent tests confirm the fix.

Fixes race conditions in YAML-based metrics and sources I/O by adding
an embedded `sync.Mutex` to serialize read–modify–write cycles so
concurrent updates are not lost. Public methods now lock and call
unlocked internal helpers (`getMetrics/getSources`,
`writeMetrics/writeSources`), and new concurrent tests confirm the fix.
@pashagolub pashagolub self-assigned this Feb 17, 2026
@pashagolub pashagolub added bug Something isn't working metrics Metrics related issues sources What sources and in what way to monitor labels Feb 17, 2026
@coveralls
Copy link

Pull Request Test Coverage Report for Build 22095028525

Details

  • 63 of 63 (100.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 77.409%

Files with Coverage Reduction New Missed Lines %
internal/sinks/prometheus.go 2 75.85%
Totals Coverage Status
Change from base Build 22070653205: 0.1%
Covered Lines: 4266
Relevant Lines: 5511

💛 - Coveralls

@pashagolub pashagolub merged commit c7a9e93 into master Feb 17, 2026
9 checks passed
@pashagolub pashagolub deleted the 1198-fix-yaml-race-conditions branch February 17, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working metrics Metrics related issues sources What sources and in what way to monitor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants