docs/vendor/google.golang.org/grpc
knative-automation 3d27780665
upgrade to latest dependencies (#3238)
bumping github.com/google/uuid 0e4e311...bfb86fa:
  > bfb86fa Add NewString Func (# 73)
  > b5d0d36 hash.go hash error covered and linter error fixed (# 71)
  > 9377784 Update sql.go (# 72)
  > 85223fa Reduce custom error allocation (# 70)
  > edef28d Use a custom error type for invalid lengths, replacing `fmt.Errorf` (# 69)
bumping google.golang.org/grpc 2cf12a8...577eb69:
  > 577eb69 Change version to 1.35.0 (# 4140)
  > fb40d83 xds interop: turn on circuit breaking test (# 4144)
  > 083393f xds/resolver: fix resource deletion (# 4143)
  > 85e55dc interop: update client for xds testing support (# 4108)
  > 6a318bb xds: add HTTP connection manager max_stream_duration support (# 4122)
  > 0bd76be lrs: use JSON for locality's String representation (# 4135)
  > ecc9a99 interop: remove test.proto clones/variants and use grpc-proto repo instead (# 4129)
  > 4f80d77 github: enable CodeQL checker (# 4134)
  > 829919d xds client: Updated v3 type for http connection manager (# 4137)
  > f4a20d2 xds: NACK more invalid RDS responses (# 4120)
  > 53788aa github: update bug template to link to the CVE process (# 4131)
  > 66c1393 github: improve security policy documentation (# 4130)
  > 39a500a support unix-abstract schema (# 4079)
  > 666aea1 advancedtls: add IPv6 address to certificate SAN names (# 4101)
  > 15458d2 xds: implement RouteAction timeout support (# 4116)
  > d79063f credentials/xds: Move non-user facing functionality to an internal package (# 4117)
  > 644d506 xds: Ignore application_protocols field for now (# 4115)
  > 2fad6bf xds: Implement server-side security (# 4092)
  > cfef8c7 pemfile: Update distributor only inside of the for loop (# 4114)
  > e2d2703 xds: NACK resource when security config is not as expected (# 4113)
  > 668e3ae testing: stop listening on externally-visible devices (# 4112)
  > 20f4a84 xds: Expect certprovider bootstrap configs when xdsCreds are in use (# 4111)
  > 73671ae Updated test.proto to facilitate xds interop testing (# 4109)
  > 4cd551e xds: split routing balancer into config selector + cluster manager (# 4083)
  > 17e2cbe credentials/xds: ServerHandshake() implementation (# 4089)
  > 03d4b88 github: Get tests111 to actually run subset of tests (# 4104)
  > 81b95b1 github: Run only a subset of tests for Go1.11 (# 4102)
  > c638ab8 Update envoyproxy/go-control-plane (# 4098)
  > fd32f6a internal/syscall: make Rusage a type alias (# 4088)
  > ff16195 xds: Implement circuit breaking support. (# 4050)
  > 750abe8 resolver: allow config selector to return an RPC error (# 4082)
  > f64220f xds: Process `require_client_cert` field in security config (# 4090)
  > 96a834a xds: `server_features` should be a child of `xds_servers` and not a sibling (# 4087)
  > bce1fdf eds/lrs: handle nil when LRS is disabled (# 4086)
  > 0d6a24f test: move stubServer to separate package in internal (# 4081)
  > 9db56a0 advancedtls: add examples demonstrating reloading behaviors (# 4018)
  > c7df457 credentials/xds: Rename test file (# 4077)
  > 2efef8f advancedtls: fix default host name check issue (# 4069)
  > f1149b9 xds: support server-side listeners in LDS response (# 4046)
  > 5b1874a xds: Handle child policy configs properly (# 4071)
  > 4a0125a roundrobin: strip attributes from addresses (# 4024)
  > c456688 client: fix "unix" scheme handling for some corner cases (# 4021)
  > 44e408d Makefile: enable module support in deps (# 4062)
  > 53c8623 Makefile: Restore `deps` and `testdeps` (# 4060)
  > a82c291 github: Don't use `make` in testing.yaml (# 4059)
  > 8238a33 advancedtls: make sni test check common name only (# 4055)
  > 21570d7 xds: Read server_resource_name_id from bootstrap config (# 4049)
  > 8f3cc6c protoc-gen-go-grpc: export grpc.ServiceDesc (# 4035)
  > 6d0f011 meshca: Don't use the config proto from grpc-proto (# 4056)
  > 9da74c0 xds: Blank import supported certificate provider plugins. (# 4047)
  > 8736dcd xds: Accept a net.Listener in Serve(). (# 4052)
  > 83af853 trim the Makefile (# 4054)
  > f6c335c github: Bump up Go version in testing workflow (# 4051)
  > 4007609 xds: call xdsclient.New instead of getting xds_client from attributes (# 4032)
  > 2af65e8 advancedtls: Make test happy on Go1.15 (# 4053)
  > 7886479 balancer: set RPC metadata in address attributes, instead of Metadata field (# 4041)
  > 230166b xds: Use management server from go-control-plane. (# 4039)
  > c5cf514 github acitons: always run (# 4045)
  > 8f12696 Fix typo in encoding.md (# 4020)
  > fa59d20 pemfile: Implement certprovider config parsing API (# 4023)
  > 3d14af9 Change version to 1.35.0-dev (# 4044)
bumping knative.dev/net-istio 7478e14...d78daae:
  > d78daae Bump Golang version to 1.15 (# 516)
  > cfcda85 upgrade to latest dependencies (# 509)
  > 3bba898 Update common github actions (# 513)

Signed-off-by: Knative Automation <automation@knative.team>
2021-02-12 04:34:41 -08:00
..
attributes upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
backoff Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
balancer upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
binarylog/grpc_binarylog_v1 upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
codes Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
connectivity upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
credentials upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
encoding upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
grpclog upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
internal upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
keepalive Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
metadata Add real build/unit presubmit tests (#734) 2019-01-10 14:23:42 -08:00
peer Add real build/unit presubmit tests (#734) 2019-01-10 14:23:42 -08:00
reflection upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
resolver upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
serviceconfig upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
stats Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
status Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
tap upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
.travis.yml upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
AUTHORS Add real build/unit presubmit tests (#734) 2019-01-10 14:23:42 -08:00
CODE-OF-CONDUCT.md Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
CONTRIBUTING.md upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
GOVERNANCE.md Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
LICENSE Add real build/unit presubmit tests (#734) 2019-01-10 14:23:42 -08:00
MAINTAINERS.md Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
Makefile upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
README.md upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
SECURITY.md upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
backoff.go upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
balancer_conn_wrappers.go Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
call.go Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
clientconn.go upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
codec.go Add real build/unit presubmit tests (#734) 2019-01-10 14:23:42 -08:00
codegen.sh Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
dialoptions.go upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
doc.go Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
go.mod upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
go.sum upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
install_gae.sh upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
interceptor.go upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
picker_wrapper.go Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
pickfirst.go Fix the go mod vendor path for knative test-infra (#2785) 2020-08-28 10:37:07 -07:00
preloader.go upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
regenerate.sh upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
resolver_conn_wrapper.go upgrade to latest dependencies (#2986) 2020-10-29 14:01:36 -07:00
rpc_util.go upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
server.go upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
service_config.go upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00
stream.go upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
trace.go Switch from dep to go mod (#2718) 2020-08-26 13:58:06 -07:00
version.go upgrade to latest dependencies (#3238) 2021-02-12 04:34:41 -08:00
vet.sh upgrade to latest dependencies (#3105) 2021-01-04 07:41:31 -08:00

README.md

gRPC-Go

Build Status GoDoc GoReportCard

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 Go gRPC docs, or jump directly into the quick start.

Prerequisites

Installation

With Go module support (Go 1.11+), simply add the following import

import "google.golang.org/grpc"

to your code, and then go [build|run|test] will automatically fetch the necessary dependencies.

Otherwise, to install the grpc-go package, run the following command:

$ go get -u google.golang.org/grpc

Note: If you are trying to access grpc-go from China, see the FAQ below.

Learn more

FAQ

I/O Timeout Errors

The golang.org domain may be blocked from some countries. go get usually produces an error like the following when this happens:

$ go get -u google.golang.org/grpc
package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

To build Go code, there are several options:

  • Set up a VPN and access google.golang.org through that.

  • Without Go module support: git clone the repo manually:

    git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
    

    You will need to do the same for all of grpc's dependencies in golang.org, e.g. golang.org/x/net.

  • With Go module support: it is possible to use the replace feature of go mod to create aliases for golang.org packages. In your project's directory:

    go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest
    go mod tidy
    go mod vendor
    go build -mod=vendor
    

    Again, this will need to be done for all transitive dependencies hosted on golang.org as well. For details, refer to golang/go issue #28652.

Compiling error, undefined: grpc.SupportPackageIsVersion

If you are using Go modules:

Ensure your gRPC-Go version is required at the appropriate version in the same module containing the generated .pb.go files. For example, SupportPackageIsVersion6 needs v1.27.0, so in your go.mod file:

module <your module name>

require (
    google.golang.org/grpc v1.27.0
)

If you are not using Go modules:

Update the 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

How to turn on logging

The default logger is controlled by environment variables. Turn everything on like this:

$ export GRPC_GO_LOG_VERBOSITY_LEVEL=99
$ export 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:

  1. mis-configured transport credentials, connection failed on handshaking
  2. bytes disrupted, possibly by a proxy in between
  3. server shutdown
  4. Keepalive parameters caused connection shutdown, for example if you have configured your server to terminate connections regularly to trigger DNS lookups. If this is the case, you may want to increase your MaxConnectionAgeGrace, to allow longer RPC calls to finish.

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.