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

indexheader: call to Snapshotter.Stop must wait for its Start to finish #8441

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

narqo
Copy link
Contributor

@narqo narqo commented Jun 20, 2024

What this PR does

This one updates indexheader.Snapshotter in a way so the calls to Stop waited until the goroutine inside Start finished. This resolves occasional issues we see on the CI

--- FAIL: TestLabelValues_Cancelled (0.07s)
    bucket_test.go:2909: Creating 2 1-sample series with 1ms interval in /tmp/TestLabelValues_Cancelled3429144703/001/0
    bucket_test.go:2909: Creating 2 1-sample series with 1ms interval in /tmp/TestLabelValues_Cancelled3429144703/001/1
    testing.go:1231: TempDir RemoveAll cleanup: unlinkat /tmp/TestLabelValues_Cancelled3429144703/001: directory not empty

I think this is a simpler way to resolve the issue, and also I'm not sure #8434 actually solves it. I'm opening the PR just to remove extra burden from Marco.

Which issue(s) this PR fixes or relates to

Fixes #8428
Closes #8434

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
@narqo narqo requested a review from a team as a code owner June 20, 2024 11:33
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM, I think I prefer this approach to #8434 because it also applies to regular shutdowns and solves the race condition

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

I think it does the job. As a follow up experiment, I will try to convert Snapshotter into a services.Service to keep it more consistent with the rest of the code base.

@pracucci pracucci merged commit 7f27d08 into main Jun 21, 2024
29 checks passed
@pracucci pracucci deleted the vldmr/fix-snapshotter-start-stop branch June 21, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky TestLabelNames_Cancelled
3 participants