Skip to content

Commit

Permalink
Merge pull request grafana/phlare#386 from grafana/race-phone
Browse files Browse the repository at this point in the history
Fixes a race in the usage reporter
  • Loading branch information
cyriltovena authored Nov 1, 2022
2 parents 8d08da4 + 52adda6 commit fba56aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/usagestats/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func (rep *Reporter) initLeader(ctx context.Context) ClusterSeed {
return nil, false, nil
}
}
return &seed, true, nil

return seed.Clone(), true, nil
}); err != nil {
level.Info(rep.logger).Log("msg", "failed to CAS cluster seed key", "err", err)
continue
Expand Down
2 changes: 1 addition & 1 deletion pkg/usagestats/seed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func createMemberlist(t *testing.T, port, memberID int) *memberlist.KV {
}

func Test_Memberlist(t *testing.T) {
stabilityCheckInterval = time.Second
stabilityCheckInterval = 100 * time.Millisecond

objectClient, err := client.NewBucket(context.Background(), client.Config{
StorageBackendConfig: client.StorageBackendConfig{
Expand Down

0 comments on commit fba56aa

Please # to comment.