-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: stop using math/rand.Seed #16428
Comments
Thanks for raising this @gocurr. More context here for anyone interested: golang/go#54880 Looks like eight instances to consider updating: ➜ find . -name "*.go" -type f -print | xargs grep .Seed
./pkg/stringutil/rand.go: rand.Seed(time.Now().UnixNano())
./pkg/adt/interval_tree_test.go: rand.Seed(time.Now().UnixNano())
./pkg/proxy/server.go: mrand.Seed(int64(now.Nanosecond()))
./pkg/proxy/server_test.go: rand.Seed(now)
./tests/integration/clientv3/snapshot/v3_snapshot_test.go: rand.Seed(int64(time.Now().Nanosecond()))
./server/lease/lessor_bench_test.go: rand.Seed(time.Now().UTC().UnixNano())
./server/etcdserver/server.go: rand.Seed(time.Now().UnixNano()) |
I think perhaps you should check other deprecated APIs. |
The only other formal deprecation I can see that impacts us for 1.20 is deprecation of |
Anyone want to fix it? |
We welcome contributions so please feel free if you have capacity! Happy to assign it to you just let us know. |
Seems to me, there are two approaches.
|
hi @gocurr @jmhbnz |
I'm not working on this currently. @gocurr did you make a start on this?
Ideally we should be just removing the |
A PR to this issue was just created. |
Please take a look. |
Bug report criteria
What happened?
It's updated to Go 1.20 minor release, however math/rand.Seed is marked "Deprecated":
What did you expect to happen?
Stop using math/rand.Seed.
How can we reproduce it (as minimally and precisely as possible)?
Use the new API as suggested.
Anything else we need to know?
No response
Etcd version (please run commands below)
Versions updated to Go 1.20.
Etcd configuration (command line flags or environment variables)
No response
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: