Skip to content

Conversation

@phmx
Copy link
Contributor

@phmx phmx commented Sep 22, 2025

There is a data race between routing tables update go-routines when tests are ran with -race flag:

WARNING: DATA RACE
Write at 0x00c00040ec20 by goroutine 298:
  github.com/olric-data/olric/internal/cluster/routingtable.(*RoutingTable).updateRoutingTableOnCluster.(*Members).Range.(*RoutingTable).updateRoutingTableOnCluster.func1.func2()
      /home/maxim/.local/go/pkg/mod/github.com/olric-data/[email protected]/internal/cluster/routingtable/update.go:88 +0xeb
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/maxim/.local/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x86

Previous read at 0x00c00040ec20 by goroutine 297:
  github.com/olric-data/olric/internal/cluster/routingtable.(*RoutingTable).updateRoutingTableOnCluster.(*Members).Range.(*RoutingTable).updateRoutingTableOnCluster.func1.func2()
      /home/maxim/.local/go/pkg/mod/github.com/olric-data/[email protected]/internal/cluster/routingtable/update.go:88 +0x12f
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/maxim/.local/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x86

Same captured err variable is shared between several go-routines.

There is a data race between routing tables update go-routines when tests are
ran with `-race` flag:
```
WARNING: DATA RACE
Write at 0x00c00040ec20 by goroutine 298:
  github.com/olric-data/olric/internal/cluster/routingtable.(*RoutingTable).updateRoutingTableOnCluster.(*Members).Range.(*RoutingTable).updateRoutingTableOnCluster.func1.func2()
      /home/maxim/.local/go/pkg/mod/github.com/olric-data/[email protected]/internal/cluster/routingtable/update.go:88 +0xeb
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/maxim/.local/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x86

Previous read at 0x00c00040ec20 by goroutine 297:
  github.com/olric-data/olric/internal/cluster/routingtable.(*RoutingTable).updateRoutingTableOnCluster.(*Members).Range.(*RoutingTable).updateRoutingTableOnCluster.func1.func2()
      /home/maxim/.local/go/pkg/mod/github.com/olric-data/[email protected]/internal/cluster/routingtable/update.go:88 +0x12f
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/maxim/.local/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x86
```

Same captured `err` variable is shared between several go-routines.
@buraksezer buraksezer merged commit 65285b4 into olric-data:master Sep 22, 2025
5 of 6 checks passed
@buraksezer
Copy link
Collaborator

Thank you for your contribution. I'm going to review your previous PRs. @phmx

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.

2 participants