Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexshipper/storage: fix race conditions #10314

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

bboreham
Copy link
Contributor

What this PR does / why we need it:
There were many race conditions reported if you run go test -race on this package.
Google's 'singleflight' package is much neater and makes all the race warnings go away.

Which issue(s) this PR fixes:
Relates to #8586

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • NA Documentation added
  • NA Tests updated
  • CHANGELOG.md updated
    • NA If the change is worth mentioning in the release notes, add add-to-release-notes label
  • NA Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • NA For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR

@bboreham bboreham requested a review from a team as a code owner August 22, 2023 19:41
Copy link
Contributor

@chaudum chaudum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do you also want to add a changelog entry?
@sandeepsukhani you might also wanna have a look.

Google's 'singleflight' package is much neater and makes all the race warnings go away.
@bboreham
Copy link
Contributor Author

Rebased and added a changelog entry.

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeschkies jeschkies merged commit a32cbeb into grafana:main Aug 30, 2023
2 checks passed
chaudum pushed a commit that referenced this pull request Sep 14, 2023
There were many race conditions reported if you run `go test -race` on
this package.
Google's 'singleflight' package is much neater and makes all the race
warnings go away.

**Which issue(s) this PR fixes**:
Relates to #8586
chaudum added a commit that referenced this pull request Sep 14, 2023
There were many race conditions reported if you run `go test -race` on this package.
Google's 'singleflight' package is much neater and makes all the race warnings go away.

**Which issue(s) this PR fixes**:

Relates to #8586

**Special notes for your reviewer**:

This is a backport of #10314 to the
2.9.x release branch.

---------

Signed-off-by: Christian Haudum <[email protected]>
Co-authored-by: Bryan Boreham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants