Fixes #3837 ``` $ go test google.golang.org/grpc/... ok google.golang.org/grpc 24.275s ? google.golang.org/grpc/balancer [no test files] ? google.golang.org/grpc/balancer/base [no test files] ok google.golang.org/grpc/balancer/grpclb 7.271s ? google.golang.org/grpc/balancer/grpclb/grpc_lb_v1 [no test files] ok google.golang.org/grpc/balancer/roundrobin 0.427s ok google.golang.org/grpc/benchmark 0.006s [no tests to run] ? google.golang.org/grpc/benchmark/benchmain [no test files] ? google.golang.org/grpc/benchmark/benchresult [no test files] ? google.golang.org/grpc/benchmark/client [no test files] ? google.golang.org/grpc/benchmark/grpc_testing [no test files] ok google.golang.org/grpc/benchmark/latency 1.012s ok google.golang.org/grpc/benchmark/primitives 0.036s [no tests to run] ? google.golang.org/grpc/benchmark/server [no test files] ? google.golang.org/grpc/benchmark/stats [no test files] ? google.golang.org/grpc/benchmark/worker [no test files] ? google.golang.org/grpc/binarylog/grpc_binarylog_v1 [no test files] ? google.golang.org/grpc/channelz/grpc_channelz_v1 [no test files] ok google.golang.org/grpc/channelz/service 0.024s ok google.golang.org/grpc/codes 0.006s ? google.golang.org/grpc/connectivity [no test files] ok google.golang.org/grpc/credentials 0.014s ok google.golang.org/grpc/credentials/alts 0.009s ? google.golang.org/grpc/credentials/alts/internal [no test files] ok google.golang.org/grpc/credentials/alts/internal/authinfo 0.006s ok google.golang.org/grpc/credentials/alts/internal/conn 0.133s ok google.golang.org/grpc/credentials/alts/internal/handshaker 0.045s ok google.golang.org/grpc/credentials/alts/internal/handshaker/service 0.013s ? google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp [no test files] ? google.golang.org/grpc/credentials/alts/internal/testutil [no test files] ? google.golang.org/grpc/credentials/google [no test files] ? google.golang.org/grpc/credentials/oauth [no test files] ? google.golang.org/grpc/encoding [no test files] ? google.golang.org/grpc/encoding/gzip [no test files] ok google.golang.org/grpc/encoding/proto 0.075s ? google.golang.org/grpc/examples/helloworld/greeter_client [no test files] ? google.golang.org/grpc/examples/helloworld/greeter_server [no test files] ? google.golang.org/grpc/examples/helloworld/helloworld [no test files] ok google.golang.org/grpc/examples/helloworld/mock_helloworld 0.011s ? google.golang.org/grpc/examples/oauth/client [no test files] ? google.golang.org/grpc/examples/oauth/server [no test files] ? google.golang.org/grpc/examples/route_guide/client [no test files] ok google.golang.org/grpc/examples/route_guide/mock_routeguide 0.039s ? google.golang.org/grpc/examples/route_guide/routeguide [no test files] ? google.golang.org/grpc/examples/route_guide/server [no test files] ? google.golang.org/grpc/examples/rpc_errors/client [no test files] ? google.golang.org/grpc/examples/rpc_errors/server [no test files] ok google.golang.org/grpc/grpclog 0.007s ? google.golang.org/grpc/grpclog/glogger [no test files] ok google.golang.org/grpc/health 0.005s ? google.golang.org/grpc/health/grpc_health_v1 [no test files] ? google.golang.org/grpc/internal [no test files] ? google.golang.org/grpc/internal/backoff [no test files] ok google.golang.org/grpc/internal/binarylog 0.006s ok google.golang.org/grpc/internal/channelz 0.012s ? google.golang.org/grpc/internal/envconfig [no test files] ? google.golang.org/grpc/internal/grpcrand [no test files] ok google.golang.org/grpc/internal/grpcsync 0.013s ok google.golang.org/grpc/internal/leakcheck 4.052s ? google.golang.org/grpc/internal/syscall [no test files] ok google.golang.org/grpc/internal/testutils 0.002s ok google.golang.org/grpc/internal/transport 81.968s ? google.golang.org/grpc/interop [no test files] ? google.golang.org/grpc/interop/alts/client [no test files] ? google.golang.org/grpc/interop/alts/server [no test files] ? google.golang.org/grpc/interop/client [no test files] ? google.golang.org/grpc/interop/fake_grpclb [no test files] ? google.golang.org/grpc/interop/grpc_testing [no test files] ? google.golang.org/grpc/interop/http2 [no test files] ? google.golang.org/grpc/interop/server [no test files] ? google.golang.org/grpc/keepalive [no test files] ok google.golang.org/grpc/metadata 0.006s ok google.golang.org/grpc/naming 0.159s ? google.golang.org/grpc/peer [no test files] ok google.golang.org/grpc/reflection 0.016s ? google.golang.org/grpc/reflection/grpc_reflection_v1alpha [no test files] ? google.golang.org/grpc/reflection/grpc_testing [no test files] ? google.golang.org/grpc/reflection/grpc_testingv3 [no test files] ? google.golang.org/grpc/resolver [no test files] ok google.golang.org/grpc/resolver/dns 1.370s ? google.golang.org/grpc/resolver/manual [no test files] ? google.golang.org/grpc/resolver/passthrough [no test files] ok google.golang.org/grpc/stats 0.104s ? google.golang.org/grpc/stats/grpc_testing [no test files] ok google.golang.org/grpc/status 0.017s ? google.golang.org/grpc/stress/client [no test files] ? google.golang.org/grpc/stress/grpc_testing [no test files] ? google.golang.org/grpc/stress/metrics_client [no test files] ? google.golang.org/grpc/tap [no test files] ok google.golang.org/grpc/test 33.866s ok google.golang.org/grpc/test/bufconn 0.005s ? google.golang.org/grpc/test/codec_perf [no test files] ? google.golang.org/grpc/test/go_vet [no test files] ? google.golang.org/grpc/test/grpc_testing [no test files] ``` |
||
|---|---|---|
| .. | ||
| balancer | ||
| codes | ||
| connectivity | ||
| credentials | ||
| encoding | ||
| grpclog | ||
| internal | ||
| keepalive | ||
| metadata | ||
| naming | ||
| peer | ||
| resolver | ||
| stats | ||
| status | ||
| tap | ||
| .travis.yml | ||
| AUTHORS | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| backoff.go | ||
| balancer.go | ||
| balancer_conn_wrappers.go | ||
| balancer_v1_wrapper.go | ||
| call.go | ||
| clientconn.go | ||
| codec.go | ||
| codegen.sh | ||
| dialoptions.go | ||
| doc.go | ||
| go.mod | ||
| go.sum | ||
| go16.go | ||
| go17.go | ||
| install_gae.sh | ||
| interceptor.go | ||
| picker_wrapper.go | ||
| pickfirst.go | ||
| proxy.go | ||
| resolver_conn_wrapper.go | ||
| rpc_util.go | ||
| server.go | ||
| service_config.go | ||
| stream.go | ||
| trace.go | ||
| version.go | ||
| vet.sh | ||
README.md
gRPC-Go
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: Go 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 -u google.golang.org/grpc
Prerequisites
This requires Go 1.6 or later. Go 1.7 will be required soon.
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.
Performance
See the current benchmarks for some of the languages supported in this dashboard.
Status
General Availability Google Cloud Platform Launch Stages.
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/grpcprotoc --go_out=plugins=grpc:. *.proto
How to turn on logging
The default logger is controlled by the environment variables. Turn everything on by setting:
GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info
The RPC failed with error "code = Unavailable desc = transport is closing"
This error means the connection the RPC is using was closed, and there are many possible reasons, including:
- mis-configured transport credentials, connection failed on handshaking
- bytes disrupted, possibly by a proxy in between
- server shutdown
It can be tricky to debug this because the error happens on the client side but the root cause of the connection being closed is on the server side. Turn on logging on both client and server, and see if there are any transport errors.