Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor: bump grpc to v1.27.1 #49114

Merged
merged 1 commit into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 72 additions & 17 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ noverify = [
ignored = [
# Non-existent package used by a toy program in c-deps/protobuf.
"github.com/google/protobuf/examples/tutorial",
"github.com/cockroachdb/cockroach/c-deps/protobuf/benchmarks/go",
]

[[constraint]]
Expand Down Expand Up @@ -115,6 +116,16 @@ ignored = [
name = "golang.org/x/crypto"
branch = "master"

[[constraint]]
# This package should be replaced for google.golang.org/protobuf,
# but we (and various deps including etcd) continue to use this
# one. We require v1.4+.
# The package is a wrapper around the suggested replacement
# (google.golang.org/protobuf) so there's no pressing reason
# to do anything.
name = "github.com/golang/protobuf"
version = "=v1.4.1"

[[constraint]]
name = "github.com/gogo/protobuf"
source = "https://github.com/cockroachdb/gogoproto"
Expand Down Expand Up @@ -157,7 +168,19 @@ ignored = [

[[constraint]]
name = "google.golang.org/grpc"
version = "=v1.21.2"
version = "=v1.27.1"

[[constraint]]
# The grpc-gateway protoc plugin prints warnings whenever
# you have a gRPC service without a HttpRule. We have a number
# of those (and it's totally reasonable to).
# For the time being, we use a fork that has the warning removed.
# See:
# https://github.com/grpc-ecosystem/grpc-gateway/commit/ee513453fd80ce577c1a680b14300458072dad5e
# https://github.com/uber/prototool/issues/128
name = "github.com/grpc-ecosystem/grpc-gateway"
branch = "v1.14.5-nowarning"
source = "https://github.com/cockroachdb/grpc-gateway"

[prune]
go-tests = true
Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ func MaybeDecorateGRPCError(
if reGRPCAuthFailure.MatchString(msg) {
return connSecurityHint()
}
if reGRPCConnFailed.MatchString(msg) {
if reGRPCConnFailed.MatchString(msg) /* gRPC 1.21 */ ||
status.Code(errors.Cause(err)) == codes.Unavailable /* gRPC 1.27 */ {
return connRefused()
}

Expand Down
7 changes: 6 additions & 1 deletion pkg/rpc/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
opentracing "github.com/opentracing/opentracing-go"
"golang.org/x/sync/syncmap"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/encoding"
encodingproto "google.golang.org/grpc/encoding/proto"
Expand Down Expand Up @@ -898,7 +899,11 @@ func (ctx *Context) grpcDialRaw(
// Add a stats handler to measure client network stats.
dialOpts = append(dialOpts, grpc.WithStatsHandler(ctx.stats.newClient(target)))

dialOpts = append(dialOpts, grpc.WithBackoffMaxDelay(maxBackoff))
// Lower the MaxBackoff (which defaults to ~minutes) to something in the
// ~second range.
backoffConfig := backoff.DefaultConfig
backoffConfig.MaxDelay = maxBackoff
dialOpts = append(dialOpts, grpc.WithConnectParams(grpc.ConnectParams{Backoff: backoffConfig}))
dialOpts = append(dialOpts, grpc.WithKeepaliveParams(clientKeepalive))
dialOpts = append(dialOpts,
grpc.WithInitialWindowSize(initialWindowSize),
Expand Down
Loading