Don't return an error from dial if the balancer returns no initial servers (#1112)

This modifies the WithBlock behavior somewhat to block until there is at least
one valid connection.  Previously, each connection would be made serially until
all had completed successfully, with any errors returned to the caller.  Errors
are now only returned due to connecting to a backend if a balancer is not used,
or if there is an error starting the balancer itself.

Fixes #976
3 files changed
tree: 8ccb42ac21865b93943dee20cf4f667c8208b8a1
  1. benchmark/
  2. codes/
  3. credentials/
  4. Documentation/
  5. examples/
  6. grpclb/
  7. grpclog/
  8. health/
  9. internal/
  10. interop/
  11. keepalive/
  12. metadata/
  13. naming/
  14. peer/
  15. reflection/
  16. stats/
  17. stress/
  18. tap/
  19. test/
  20. testdata/
  21. transport/
  22. .travis.yml
  23. backoff.go
  24. backoff_test.go
  25. balancer.go
  26. balancer_test.go
  27. call.go
  28. call_test.go
  29. clientconn.go
  30. clientconn_test.go
  31. codegen.sh
  32. CONTRIBUTING.md
  33. coverage.sh
  34. doc.go
  35. interceptor.go
  36. LICENSE
  37. Makefile
  38. PATENTS
  39. README.md
  40. rpc_util.go
  41. rpc_util_test.go
  42. server.go
  43. server_test.go
  44. stream.go
  45. trace.go
README.md

#gRPC-Go

Build Status GoDoc

The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the gRPC Quick Start guide.

Installation

To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run:

$ go get google.golang.org/grpc

Prerequisites

This requires Go 1.5 or later.

A note on the version used: significant performance improvements in benchmarks of grpc-go have been seen by upgrading the go version from 1.5 to the latest 1.7.1.

From https://golang.org/doc/install, one way to install the latest version of go is:

$ GO_VERSION=1.7.1
$ OS=linux
$ ARCH=amd64
$ curl -O https://storage.googleapis.com/golang/go${GO_VERSION}.${OS}-${ARCH}.tar.gz
$ sudo tar -C /usr/local -xzf go$GO_VERSION.$OS-$ARCH.tar.gz
$ # Put go on the PATH, keep the usual installation dir
$ sudo ln -s /usr/local/go/bin/go /usr/bin/go
$ rm go$GO_VERSION.$OS-$ARCH.tar.gz

Constraints

The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the list, you need a discussion with gRPC-Go authors and consultants.

Documentation

See API documentation for package and API descriptions and find examples in the examples directory.

Status

GA

FAQ

Compiling error, undefined: grpc.SupportPackageIsVersion

Please update proto package, gRPC package and rebuild the proto files:

  • go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
  • go get -u google.golang.org/grpc
  • protoc --go_out=plugins=grpc:. *.proto