Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Fixes a race in the usage reporter #386

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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