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

update org_golang_google_grpc 0.13.0 #1565

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion go/private/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def go_rules_dependencies():
git_repository,
name = "org_golang_google_grpc",
remote = "https://github.com/grpc/grpc-go",
commit = "d11072e7ca9811b1100b80ca0269ac831f06d024", # v1.10.3, latest as of 2018-05-07
commit = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8", # v1.13.0, latest as of 2018-06-20
overlay = manifest["org_golang_google_grpc"],
# build_file_proto_mode = "disable",
# importpath = "google.golang.org/grpc",
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/popular_repos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ test_suite(
"@org_golang_google_grpc//credentials/alts/core/handshaker:go_default_test",
"@org_golang_google_grpc//credentials/alts/core/handshaker/service:go_default_test",
"@org_golang_google_grpc//encoding/proto:go_default_test",
"@org_golang_google_grpc//grpclb:go_default_test",
"@org_golang_google_grpc//grpclog:go_default_test",
"@org_golang_google_grpc//metadata:go_default_test",
"@org_golang_google_grpc//naming:go_default_test",
Expand All @@ -191,7 +190,6 @@ test_suite(
"@org_golang_google_grpc//stats:go_default_test",
"@org_golang_google_grpc//status:go_default_test",
"@org_golang_google_grpc//test/bufconn:go_default_test",
"@org_golang_google_grpc//test/leakcheck:go_default_test",
],
)

Expand Down
2 changes: 0 additions & 2 deletions tests/integration/popular_repos/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ This runs tests from the repository `google.golang.org/grpc <https://google.gola
* @org_golang_google_grpc//credentials/alts/core/handshaker:go_default_test
* @org_golang_google_grpc//credentials/alts/core/handshaker/service:go_default_test
* @org_golang_google_grpc//encoding/proto:go_default_test
* @org_golang_google_grpc//grpclb:go_default_test
* @org_golang_google_grpc//grpclog:go_default_test
* @org_golang_google_grpc//metadata:go_default_test
* @org_golang_google_grpc//naming:go_default_test
Expand All @@ -191,7 +190,6 @@ This runs tests from the repository `google.golang.org/grpc <https://google.gola
* @org_golang_google_grpc//stats:go_default_test
* @org_golang_google_grpc//status:go_default_test
* @org_golang_google_grpc//test/bufconn:go_default_test
* @org_golang_google_grpc//test/leakcheck:go_default_test


com_github_mattn_go_sqlite3
Expand Down
6 changes: 5 additions & 1 deletion third_party/manifest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ manifest = {
"@io_bazel_rules_go//third_party:org_golang_google_grpc/health/BUILD.bazel.in": "health/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/health/grpc_health_v1/BUILD.bazel.in": "health/grpc_health_v1/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/internal/BUILD.bazel.in": "internal/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/internal/backoff/BUILD.bazel.in": "internal/backoff/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/internal/channelz/BUILD.bazel.in": "internal/channelz/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/internal/grpcrand/BUILD.bazel.in": "internal/grpcrand/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/internal/leakcheck/BUILD.bazel.in": "internal/leakcheck/BUILD.bazel",

"@io_bazel_rules_go//third_party:org_golang_google_grpc/interop/BUILD.bazel.in": "interop/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/interop/alts/client/BUILD.bazel.in": "interop/alts/client/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/interop/alts/server/BUILD.bazel.in": "interop/alts/server/BUILD.bazel",
Expand Down Expand Up @@ -406,7 +411,6 @@ manifest = {
"@io_bazel_rules_go//third_party:org_golang_google_grpc/test/bufconn/BUILD.bazel.in": "test/bufconn/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/test/codec_perf/BUILD.bazel.in": "test/codec_perf/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/test/grpc_testing/BUILD.bazel.in": "test/grpc_testing/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/test/leakcheck/BUILD.bazel.in": "test/leakcheck/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/testdata/BUILD.bazel.in": "testdata/BUILD.bazel",
"@io_bazel_rules_go//third_party:org_golang_google_grpc/transport/BUILD.bazel.in": "transport/BUILD.bazel",
},
Expand Down
12 changes: 7 additions & 5 deletions third_party/org_golang_google_grpc/BUILD.bazel.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ go_library(
"clientconn.go",
"codec.go",
"doc.go",
"envconfig.go",
"go16.go",
"go17.go",
"grpclb.go",
"grpclb_picker.go",
"grpclb_remote_balancer.go",
"grpclb_util.go",
"interceptor.go",
"picker_wrapper.go",
"pickfirst.go",
Expand All @@ -25,8 +22,10 @@ go_library(
"rpc_util.go",
"server.go",
"service_config.go",
"stickiness_linkedmap.go",
"stream.go",
"trace.go",
"version.go",
],
importpath = "google.golang.org/grpc",
visibility = ["//visibility:public"],
Expand All @@ -41,6 +40,8 @@ go_library(
"//grpclb/grpc_lb_v1/messages:go_default_library",
"//grpclog:go_default_library",
"//internal:go_default_library",
"//internal/backoff:go_default_library",
"//internal/channelz:go_default_library",
"//keepalive:go_default_library",
"//metadata:go_default_library",
"//naming:go_default_library",
Expand Down Expand Up @@ -85,14 +86,15 @@ go_test(
"//encoding:go_default_library",
"//encoding/proto:go_default_library",
"//grpclog/glogger:go_default_library",
"//internal/backoff:go_default_library",
"//internal/channelz:go_default_library",
"//keepalive:go_default_library",
"//naming:go_default_library",
"//resolver:go_default_library",
"//resolver/manual:go_default_library",
"//resolver/passthrough:go_default_library",
"//status:go_default_library",
"//test/codec_perf:go_default_library",
"//test/leakcheck:go_default_library",
"//testdata:go_default_library",
"//transport:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ go_test(
"//:go_default_library",
"//codes:go_default_library",
"//grpclog/glogger:go_default_library",
"//internal/leakcheck:go_default_library",
"//peer:go_default_library",
"//resolver:go_default_library",
"//resolver/manual:go_default_library",
"//status:go_default_library",
"//test/grpc_testing:go_default_library",
"//test/leakcheck:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)
28 changes: 6 additions & 22 deletions third_party/org_golang_google_grpc/grpclb/BUILD.bazel.in
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_test(
name = "go_default_test",
srcs = ["grpclb_test.go"],
deps = [
"//:go_default_library",
"//balancer:go_default_library",
"//codes:go_default_library",
"//credentials:go_default_library",
"//grpclb/grpc_lb_v1/messages:go_default_library",
"//grpclb/grpc_lb_v1/service:go_default_library",
"//grpclog/glogger:go_default_library",
"//metadata:go_default_library",
"//peer:go_default_library",
"//resolver:go_default_library",
"//resolver/manual:go_default_library",
"//status:go_default_library",
"//test/grpc_testing:go_default_library",
"//test/leakcheck:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
go_library(
name = "go_default_library",
srcs = ["noimport.go"],
importpath = "google.golang.org/grpc/grpclb",
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ go_library(
srcs = ["messages.pb.go"],
importpath = "google.golang.org/grpc/grpclb/grpc_lb_v1/messages",
visibility = ["//visibility:public"],
deps = ["@com_github_golang_protobuf//proto:go_default_library"],
deps = [
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = ["backoff.go"],
importpath = "google.golang.org/grpc/internal/backoff",
visibility = ["//:__subpackages__"],
deps = ["//internal/grpcrand:go_default_library"],
)
78 changes: 78 additions & 0 deletions third_party/org_golang_google_grpc/internal/backoff/backoff.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

// Package backoff implement the backoff strategy for gRPC.
//
// This is kept in internal until the gRPC project decides whether or not to
// allow alternative backoff strategies.
package backoff

import (
"time"

"google.golang.org/grpc/internal/grpcrand"
)

// Strategy defines the methodology for backing off after a grpc connection
// failure.
//
type Strategy interface {
// Backoff returns the amount of time to wait before the next retry given
// the number of consecutive failures.
Backoff(retries int) time.Duration
}

const (
// baseDelay is the amount of time to wait before retrying after the first
// failure.
baseDelay = 1.0 * time.Second
// factor is applied to the backoff after each retry.
factor = 1.6
// jitter provides a range to randomize backoff delays.
jitter = 0.2
)

// Exponential implements exponential backoff algorithm as defined in
// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
type Exponential struct {
// MaxDelay is the upper bound of backoff delay.
MaxDelay time.Duration
}

// Backoff returns the amount of time to wait before the next retry given the
// number of retries.
func (bc Exponential) Backoff(retries int) time.Duration {
if retries == 0 {
return baseDelay
}
backoff, max := float64(baseDelay), float64(bc.MaxDelay)
for backoff < max && retries > 0 {
backoff *= factor
retries--
}
if backoff > max {
backoff = max
}
// Randomize backoff delays so that if a cluster of requests start at
// the same time, they won't operate in lockstep.
backoff *= 1 + jitter*(grpcrand.Float64()*2-1)
if backoff < 0 {
return 0
}
return time.Duration(backoff)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"funcs.go",
"types.go",
],
importpath = "google.golang.org/grpc/internal/channelz",
visibility = ["//:__subpackages__"],
deps = [
"//connectivity:go_default_library",
"//grpclog:go_default_library",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = ["grpcrand.go"],
importpath = "google.golang.org/grpc/internal/grpcrand",
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["leakcheck.go"],
importpath = "google.golang.org/grpc/test/leakcheck",
importpath = "google.golang.org/grpc/internal/leakcheck",
visibility = ["//visibility:public"],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//grpclog:go_default_library",
"//internal/grpcrand:go_default_library",
"//resolver:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
Expand All @@ -25,8 +26,9 @@ go_test(
],
embed = [":go_default_library"],
deps = [
"//internal/grpcrand:go_default_library",
"//internal/leakcheck:go_default_library",
"//resolver:go_default_library",
"//test/leakcheck:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)
13 changes: 11 additions & 2 deletions third_party/org_golang_google_grpc/status/BUILD.bazel.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = ["status.go"],
srcs = [
"go16.go",
"go17.go",
"status.go",
],
importpath = "google.golang.org/grpc/status",
visibility = ["//visibility:public"],
deps = [
"//codes:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//ptypes:go_default_library",
"@org_golang_google_genproto//googleapis/rpc/status:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = ["status_test.go"],
srcs = [
"go17_test.go",
"status_test.go",
],
embed = [":go_default_library"],
deps = [
"//codes:go_default_library",
Expand All @@ -26,5 +34,6 @@ go_test(
"@org_golang_google_genproto//googleapis/rpc/code:go_default_library",
"@org_golang_google_genproto//googleapis/rpc/errdetails:go_default_library",
"@org_golang_google_genproto//googleapis/rpc/status:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)
1 change: 0 additions & 1 deletion third_party/org_golang_google_grpc/test/BUILD.bazel.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ go_test(
"//status:go_default_library",
"//tap:go_default_library",
"//test/grpc_testing:go_default_library",
"//test/leakcheck:go_default_library",
"//testdata:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:any_go_proto",
Expand Down
6 changes: 5 additions & 1 deletion third_party/org_golang_google_grpc/transport/BUILD.bazel.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ go_library(
name = "go_default_library",
srcs = [
"bdp_estimator.go",
"control.go",
"controlbuf.go",
"flowcontrol.go",
"go16.go",
"go17.go",
"handler_server.go",
Expand All @@ -20,6 +21,8 @@ go_library(
"//codes:go_default_library",
"//credentials:go_default_library",
"//grpclog:go_default_library",
"//internal/channelz:go_default_library",
"//internal/grpcrand:go_default_library",
"//keepalive:go_default_library",
"//metadata:go_default_library",
"//peer:go_default_library",
Expand All @@ -44,6 +47,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//codes:go_default_library",
"//internal/leakcheck:go_default_library",
"//keepalive:go_default_library",
"//metadata:go_default_library",
"//status:go_default_library",
Expand Down