Use the FileLockEx wrapper and the corresponding LOCKFILE_* and error
constants from the golang.org/x/sys/windows package rather than
implementing these in the fileutil package.
`Client.dial` can be called multiple times. For example, from regular
`NewClient` and [from the `Maintenance`
wrapper](6d451ab61d/client/v3/maintenance.go (L81-L84)).
This ends up creating two (if `Client.dial` is called twice) independent
`credentials.Bundle` instances:
- the first one is wired into `PerRPCCredentials` callback in gRPC
client.
- the second one is in `Client.authTokenBundle` and receives the latest
auth token updates.
When using username/password authentication and the server is configured
to issue JWTs, token rotation logic breaks because of the above
`credentials.Bundle` confusion.
There are many developers on the web, confused by how to install etcd v3 for the development of go project.
A number of similar errors were encountered, as follows:
https://github.com/etcd-io/etcd/issues/13108
```
➜ ~ go version
go version go1.16.5 darwin/amd64
➜ ~ go get go.etcd.io/etcd/clientv3
go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974
# github.com/coreos/etcd/clientv3/balancer/picker
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
```
There are many examples of confusion here:
- https://github.com/etcd-io/etcd/issues/12577
- https://github.com/etcd-io/etcd/issues/12181
- https://github.com/etcd-io/etcd/issues/12068
- https://github.com/etcd-io/etcd/issues/11931
......
So, As suggested by @lilic , I submitted Readme update.
There are many developers on the web, confused by how to install etcd v3 for the development of go project.
A number of similar errors were encountered, as follows:
https://github.com/etcd-io/etcd/issues/13108
```
➜ ~ go version
go version go1.16.5 darwin/amd64
➜ ~ go get go.etcd.io/etcd/clientv3
go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974
# github.com/coreos/etcd/clientv3/balancer/picker
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
```
There are many examples of confusion here:
- https://github.com/etcd-io/etcd/issues/12577
- https://github.com/etcd-io/etcd/issues/12181
- https://github.com/etcd-io/etcd/issues/12068
- https://github.com/etcd-io/etcd/issues/11931
......
So, As suggested by @lilic , I submitted Readme update.
Narrowly prevent etcd from crashing when given a bad ACTIVATE payload, e.g.:
$ curl -d "{\"action\":\"ACTIVATE\"}" ${ETCD}/v3/maintenance/alarm
curl: (52) Empty reply from server