Skip to content

[-] fix data race in Prometheus sink, fixes #1136#1140

Merged
pashagolub merged 5 commits intocybertec-postgresql:masterfrom
abhijeetsharma200:fix-collect-data-race
Feb 3, 2026
Merged

[-] fix data race in Prometheus sink, fixes #1136#1140
pashagolub merged 5 commits intocybertec-postgresql:masterfrom
abhijeetsharma200:fix-collect-data-race

Conversation

@abhijeetsharma200
Copy link
Contributor

Fixes #1136.

Will add the test as part of the PR to add tests to prometheus.go

@coveralls
Copy link

coveralls commented Jan 27, 2026

Pull Request Test Coverage Report for Build 21636114330

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.9%) to 76.281%

Totals Coverage Status
Change from base Build 21636242076: 0.9%
Covered Lines: 4110
Relevant Lines: 5388

💛 - Coveralls

@abhijeetsharma200
Copy link
Contributor Author

@pashagolub ping for review

@pashagolub
Copy link
Collaborator

Could you please add a test case that must fail before the change and is working now. Thanks

@abhijeetsharma200
Copy link
Contributor Author

Could you please add a test case that must fail before the change and is working now. Thanks

Done! Please let me know if there any additional changes necessary

@pashagolub pashagolub added bug Something isn't working sinks Where and how to store monitored data labels Feb 2, 2026
@pashagolub pashagolub force-pushed the fix-collect-data-race branch from 3505760 to 2c3e3e2 Compare February 3, 2026 13:33
@pashagolub pashagolub self-assigned this Feb 3, 2026
@pashagolub pashagolub force-pushed the fix-collect-data-race branch from 440017c to dcb0b4a Compare February 3, 2026 15:23
@pashagolub pashagolub changed the title Fixed data race in Collect() [-] fix data race in Prometheus sink, fixes #1136 Feb 3, 2026
@pashagolub pashagolub merged commit 46805e2 into cybertec-postgresql:master Feb 3, 2026
5 checks passed
@pashagolub
Copy link
Collaborator

Thanks!

@abhijeetsharma200
Copy link
Contributor Author

old design. should be a part of a struct actually

I see, can I then open an issue to refactor it and make it part of a struct?

@pashagolub
Copy link
Collaborator

absolutely. be my guest! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sinks Where and how to store monitored data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data race in PrometheusWriter(concurrent map iteration/write)

4 participants