Skip to content

Commit 919caa0

Browse files
Merge remote-tracking branch 'origin/master' into stats-retry-attempts-fix-8299
2 parents c9c6f4c + 0a895bc commit 919caa0

18 files changed

Lines changed: 338 additions & 174 deletions

File tree

cmd/protoc-gen-go-grpc/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module google.golang.org/grpc/cmd/protoc-gen-go-grpc
22

3-
go 1.23
3+
go 1.23.0
44

55
require (
66
google.golang.org/grpc v1.70.0
@@ -11,8 +11,8 @@ require (
1111
github.com/google/go-cmp v0.7.0 // indirect
1212
go.opentelemetry.io/otel v1.34.0 // indirect
1313
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
14-
golang.org/x/net v0.35.0 // indirect
15-
golang.org/x/sys v0.30.0 // indirect
16-
golang.org/x/text v0.22.0 // indirect
14+
golang.org/x/net v0.38.0 // indirect
15+
golang.org/x/sys v0.31.0 // indirect
16+
golang.org/x/text v0.23.0 // indirect
1717
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
1818
)

cmd/protoc-gen-go-grpc/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce
2020
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
2121
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
2222
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
23-
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
24-
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
25-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
26-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
27-
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
28-
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
23+
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
24+
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
25+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
26+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
27+
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
28+
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
2929
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
3030
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
3131
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=

examples/features/opentelemetry/client/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import (
4343
)
4444

4545
var (
46-
addr = flag.String("addr", ":50051", "the server address to connect to")
46+
addr = flag.String("addr", "localhost:50051", "the server address to connect to")
4747
prometheusEndpoint = flag.String("prometheus_endpoint", ":9465", "the Prometheus exporter endpoint for metrics")
4848
)
4949

@@ -70,8 +70,8 @@ func main() {
7070
// up-to-date list of metrics, see:
7171
// https://grpc.io/docs/guides/opentelemetry-metrics/#instruments
7272
Metrics: opentelemetry.DefaultMetrics().Add(
73-
"grpc.client.attempt.started",
74-
"grpc.client.attempt.duration",
73+
"grpc.lb.pick_first.connection_attempts_succeeded",
74+
"grpc.lb.pick_first.connection_attempts_failed",
7575
),
7676
},
7777
TraceOptions: oteltracing.TraceOptions{TracerProvider: traceProvider, TextMapPropagator: textMapPropagator},

examples/features/opentelemetry/server/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
)
4343

4444
var (
45-
addr = flag.String("addr", ":50051", "the server address to connect to")
45+
addr = flag.String("addr", "localhost:50051", "the server address to connect to")
4646
prometheusEndpoint = flag.String("prometheus_endpoint", ":9464", "the Prometheus exporter endpoint for metrics")
4747
)
4848

@@ -78,8 +78,8 @@ func main() {
7878
// up-to-date list of metrics, see:
7979
// https://grpc.io/docs/guides/opentelemetry-metrics/#instruments
8080
Metrics: opentelemetry.DefaultMetrics().Add(
81-
"grpc.server.call.started",
82-
"grpc.server.call.duration",
81+
"grpc.lb.pick_first.connection_attempts_succeeded",
82+
"grpc.lb.pick_first.connection_attempts_failed",
8383
),
8484
},
8585
TraceOptions: oteltracing.TraceOptions{TracerProvider: traceProvider, TextMapPropagator: textMapPropagator}})

security/advancedtls/advancedtls_integration_test.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,11 @@ func callAndVerify(ctx context.Context, msg string, client pb.GreeterClient, sho
9797
// TODO(ZhenLian): remove shouldFail and add ...DialOption to the function
9898
// signature to provider cleaner tests.
9999
func callAndVerifyWithClientConn(ctx context.Context, address string, msg string, creds credentials.TransportCredentials, shouldFail bool) (*grpc.ClientConn, pb.GreeterClient, error) {
100-
var conn *grpc.ClientConn
101-
var err error
102-
// If we want the test to fail, we establish a non-blocking connection to
103-
// avoid it hangs and killed by the context.
104-
if shouldFail {
105-
conn, err = grpc.NewClient(address, grpc.WithTransportCredentials(creds))
106-
if err != nil {
107-
return nil, nil, fmt.Errorf("client failed to connect to %s. Error: %v", address, err)
108-
}
109-
} else {
110-
conn, err = grpc.NewClient(address, grpc.WithTransportCredentials(creds), grpc.WithBlock())
111-
if err != nil {
112-
return nil, nil, fmt.Errorf("client failed to connect to %s. Error: %v", address, err)
113-
}
100+
// Disable service config lookups as it results in a DNS lookup which can
101+
// flake in CI.
102+
conn, err := grpc.NewClient(address, grpc.WithTransportCredentials(creds), grpc.WithDisableServiceConfig())
103+
if err != nil {
104+
return nil, nil, fmt.Errorf("client failed to connect to %s. Error: %v", address, err)
114105
}
115106
greetClient := pb.NewGreeterClient(conn)
116107
err = callAndVerify(ctx, msg, greetClient, shouldFail)

security/advancedtls/crl_provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (s) TestFileWatcherCRLProviderConfig(t *testing.T) {
119119
tooFastRefreshProvider.Close()
120120

121121
customCallback := func(err error) {
122-
fmt.Printf("Custom error message: %v", err)
122+
t.Logf("Custom error message: %v", err)
123123
}
124124
regularProvider, err := NewFileWatcherCRLProvider(FileWatcherOptions{
125125
CRLDirectory: testdata.Path("crl"),

stats/opentelemetry/example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ func ExampleOptions_addExperimentalMetrics() {
137137
// up-to-date list of metrics, see:
138138
// https://grpc.io/docs/guides/opentelemetry-metrics/#instruments
139139
Metrics: opentelemetry.DefaultMetrics().Add(
140-
"grpc.client.attempt.started",
141-
"grpc.client.attempt.duration",
140+
"grpc.lb.pick_first.connection_attempts_succeeded",
141+
"grpc.lb.pick_first.connection_attempts_failed",
142142
),
143143
},
144144
}

xds/internal/balancer/clusterimpl/clusterimpl.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"context"
2828
"encoding/json"
2929
"fmt"
30+
"slices"
3031
"sync"
3132
"sync/atomic"
3233
"time"
@@ -128,7 +129,7 @@ type clusterImplBalancer struct {
128129
// indicating if a new picker needs to be generated.
129130
func (b *clusterImplBalancer) handleDropAndRequestCountLocked(newConfig *LBConfig) bool {
130131
var updatePicker bool
131-
if !equalDropCategories(b.dropCategories, newConfig.DropCategories) {
132+
if !slices.Equal(b.dropCategories, newConfig.DropCategories) {
132133
b.dropCategories = newConfig.DropCategories
133134
b.drops = make([]*dropper, 0, len(newConfig.DropCategories))
134135
for _, c := range newConfig.DropCategories {

xds/internal/balancer/clusterimpl/config.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,3 @@ func parseConfig(c json.RawMessage) (*LBConfig, error) {
5555
}
5656
return &cfg, nil
5757
}
58-
59-
func equalDropCategories(a, b []DropConfig) bool {
60-
if len(a) != len(b) {
61-
return false
62-
}
63-
for i := range a {
64-
if a[i] != b[i] {
65-
return false
66-
}
67-
}
68-
return true
69-
}

xds/internal/balancer/priority/utils.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)