Skip to content

Commit

Permalink
fix: data race in bloombuild tests (#15360)
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- authored Dec 11, 2024
1 parent 42469cc commit aa7b849
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/bloombuild/planner/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,10 @@ func (f *fakeBuilder) Send(req *protos.PlannerToBuilder) error {
}

func (f *fakeBuilder) Recv() (*protos.BuilderToPlanner, error) {
if len(f.tasks) == 0 {
f.mx.Lock()
tasksLen := len(f.tasks)
f.mx.Unlock()
if tasksLen == 0 {
// First call to Recv answers with builderID
return &protos.BuilderToPlanner{
BuilderID: f.id,
Expand Down

0 comments on commit aa7b849

Please sign in to comment.