Skip to content

Commit

Permalink
util/etcd: workaround for upstream cancellation problem
Browse files Browse the repository at this point in the history
Seems like grpc/grpc-go#2733 has resulted
in behaviour where any attempt to gRPC dial with a timeout gives
a cancelled-context error.
  • Loading branch information
daviddrysdale committed Apr 3, 2019
1 parent 935d46a commit d196181
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/trillian_log_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func main() {

client, err := etcd.NewClientFromString(*server.EtcdServers)
if err != nil {
glog.Exitf("Failed to connect to etcd at %v: %v", server.EtcdServers, err)
glog.Exitf("Failed to connect to etcd at %v: %v", *server.EtcdServers, err)
}

// Announce our endpoints to etcd if so configured.
Expand Down
6 changes: 4 additions & 2 deletions util/etcd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ import (
// the same version of etcd in external codebases. Could Go modules help?
func NewClient(endpoints []string, dialTimeout time.Duration) (*clientv3.Client, error) {
return clientv3.New(clientv3.Config{
Endpoints: endpoints,
DialTimeout: dialTimeout,
Endpoints: endpoints,
// TODO(daviddrysdale): re-enable dial timeout when upstream client code fixed
// for https://github.com/grpc/grpc-go/pull/2733/files#r271705181
// DialTimeout: dialTimeout,
})
}

Expand Down

0 comments on commit d196181

Please sign in to comment.