Skip to content

Commit aa7b849

Browse files
authored
fix: data race in bloombuild tests (#15360)
1 parent 42469cc commit aa7b849

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎pkg/bloombuild/planner/planner_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,10 @@ func (f *fakeBuilder) Send(req *protos.PlannerToBuilder) error {
713713
}
714714

715715
func (f *fakeBuilder) Recv() (*protos.BuilderToPlanner, error) {
716-
if len(f.tasks) == 0 {
716+
f.mx.Lock()
717+
tasksLen := len(f.tasks)
718+
f.mx.Unlock()
719+
if tasksLen == 0 {
717720
// First call to Recv answers with builderID
718721
return &protos.BuilderToPlanner{
719722
BuilderID: f.id,

0 commit comments

Comments
 (0)