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

fix: data race in bloombuild tests #15360

Merged
merged 1 commit into from
Dec 11, 2024
Merged

fix: data race in bloombuild tests #15360

merged 1 commit into from
Dec 11, 2024

Conversation

na--
Copy link
Member

@na-- na-- commented Dec 11, 2024

What this PR does / why we need it:

The tests failed when executed with -race with the following data race warning:

WARNING: DATA RACE
Write at 0x00c00624a118 by goroutine 94542:
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*fakeBuilder).Send()
      pkg/bloombuild/planner/planner_test.go:710 +0x1f5
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*Planner).forwardTaskToBuilder()
      pkg/bloombuild/planner/planner.go:842 +0xf9
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*Planner).BuilderLoop()
      pkg/bloombuild/planner/planner.go:777 +0xdcc
  github.com/grafana/loki/v3/pkg/bloombuild/planner.Test_BuilderLoop.func8.2()
      pkg/bloombuild/planner/planner_test.go:199 +0x5a
  github.com/grafana/loki/v3/pkg/bloombuild/planner.Test_BuilderLoop.func8.gowrap1()
      pkg/bloombuild/planner/planner_test.go:201 +0x4f

Previous read at 0x00c00624a118 by goroutine 94673:
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*fakeBuilder).Recv()
      pkg/bloombuild/planner/planner_test.go:716 +0x5e
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*Planner).receiveResultFromBuilder()
      pkg/bloombuild/planner/planner.go:889 +0x64
  github.com/grafana/loki/v3/pkg/bloombuild/planner.(*Planner).forwardTaskToBuilder.func1()
      pkg/bloombuild/planner/planner.go:851 +0xa4
...
==================
--- FAIL: Test_BuilderLoop (15.23s)
    --- FAIL: Test_BuilderLoop/timeout (5.05s)
        testing.go:1399: race detected during execution of test
FAIL
FAIL	github.com/grafana/loki/v3/pkg/bloombuild/planner	21.193s

@na-- na-- requested a review from a team as a code owner December 11, 2024 13:07
@na-- na-- merged commit aa7b849 into main Dec 11, 2024
60 checks passed
@na-- na-- deleted the ned/fix-data-race-01 branch December 11, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants