Skip to content

Commit 9390057

Browse files
authored
Merge branch 'master' into master
2 parents c05feed + b46bdef commit 9390057

File tree

196 files changed

+8578
-3219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+8578
-3219
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727

2828
# Initializes the CodeQL tools for scanning.
2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v1
30+
uses: github/codeql-action/init@v2
3131
with:
3232
languages: go
3333

3434
- name: Perform CodeQL Analysis
35-
uses: github/codeql-action/analyze@v1
35+
uses: github/codeql-action/analyze@v2

.github/workflows/testing.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Go
2727
uses: actions/setup-go@v2
2828
with:
29-
go-version: 1.19
29+
go-version: '1.20'
3030
- name: Checkout repo
3131
uses: actions/checkout@v2
3232

@@ -46,31 +46,31 @@ jobs:
4646
matrix:
4747
include:
4848
- type: vet
49-
goversion: 1.19
49+
goversion: '1.20'
5050

5151
- type: tests
52-
goversion: 1.19
52+
goversion: '1.20'
5353

5454
- type: tests
55-
goversion: 1.19
55+
goversion: '1.20'
5656
testflags: -race
5757

5858
- type: tests
59-
goversion: 1.19
59+
goversion: '1.20'
6060
goarch: 386
6161

6262
- type: tests
63-
goversion: 1.19
63+
goversion: '1.20'
6464
goarch: arm64
6565

6666
- type: tests
67-
goversion: 1.18
67+
goversion: '1.19'
6868

6969
- type: tests
70-
goversion: 1.17
70+
goversion: '1.18'
7171

7272
- type: extras
73-
goversion: 1.19
73+
goversion: '1.20'
7474

7575
steps:
7676
# Setup the environment.

admin/test/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636

3737
v3statusgrpc "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
3838
v3statuspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
39+
channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1"
3940
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
4041
)
4142

@@ -55,7 +56,6 @@ type ExpectedStatusCodes struct {
5556
func RunRegisterTests(t *testing.T, ec ExpectedStatusCodes) {
5657
nodeID := uuid.New().String()
5758
bootstrapCleanup, err := bootstrap.CreateFile(bootstrap.Options{
58-
Version: bootstrap.TransportV3,
5959
NodeID: nodeID,
6060
ServerURI: "no.need.for.a.server",
6161
})
@@ -99,7 +99,7 @@ func RunRegisterTests(t *testing.T, ec ExpectedStatusCodes) {
9999

100100
// RunChannelz makes a channelz RPC.
101101
func RunChannelz(conn *grpc.ClientConn) error {
102-
c := channelzpb.NewChannelzClient(conn)
102+
c := channelzgrpc.NewChannelzClient(conn)
103103
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
104104
defer cancel()
105105
_, err := c.GetTopChannels(ctx, &channelzpb.GetTopChannelsRequest{}, grpc.WaitForReady(true))

balancer/grpclb/grpc_lb_v1/load_balancer.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binarylog/grpc_binarylog_v1/binarylog.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channelz/grpc_channelz_v1/channelz.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channelz/grpc_channelz_v1/channelz_grpc.pb.go

Lines changed: 26 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channelz/service/func_linux.go

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
durpb "github.com/golang/protobuf/ptypes/duration"
2626
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
2727
"google.golang.org/grpc/internal/channelz"
28-
"google.golang.org/grpc/internal/testutils"
2928
)
3029

3130
func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
@@ -35,32 +34,47 @@ func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
3534
func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOption {
3635
var opts []*channelzpb.SocketOption
3736
if skopts.Linger != nil {
38-
opts = append(opts, &channelzpb.SocketOption{
39-
Name: "SO_LINGER",
40-
Additional: testutils.MarshalAny(&channelzpb.SocketOptionLinger{
41-
Active: skopts.Linger.Onoff != 0,
42-
Duration: convertToPtypesDuration(int64(skopts.Linger.Linger), 0),
43-
}),
37+
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionLinger{
38+
Active: skopts.Linger.Onoff != 0,
39+
Duration: convertToPtypesDuration(int64(skopts.Linger.Linger), 0),
4440
})
41+
if err == nil {
42+
opts = append(opts, &channelzpb.SocketOption{
43+
Name: "SO_LINGER",
44+
Additional: additional,
45+
})
46+
} else {
47+
logger.Warningf("Failed to marshal socket options linger %+v: %v", skopts.Linger, err)
48+
}
4549
}
4650
if skopts.RecvTimeout != nil {
47-
opts = append(opts, &channelzpb.SocketOption{
48-
Name: "SO_RCVTIMEO",
49-
Additional: testutils.MarshalAny(&channelzpb.SocketOptionTimeout{
50-
Duration: convertToPtypesDuration(int64(skopts.RecvTimeout.Sec), int64(skopts.RecvTimeout.Usec)),
51-
}),
51+
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTimeout{
52+
Duration: convertToPtypesDuration(int64(skopts.RecvTimeout.Sec), int64(skopts.RecvTimeout.Usec)),
5253
})
54+
if err == nil {
55+
opts = append(opts, &channelzpb.SocketOption{
56+
Name: "SO_RCVTIMEO",
57+
Additional: additional,
58+
})
59+
} else {
60+
logger.Warningf("Failed to marshal socket options receive timeout %+v: %v", skopts.RecvTimeout, err)
61+
}
5362
}
5463
if skopts.SendTimeout != nil {
55-
opts = append(opts, &channelzpb.SocketOption{
56-
Name: "SO_SNDTIMEO",
57-
Additional: testutils.MarshalAny(&channelzpb.SocketOptionTimeout{
58-
Duration: convertToPtypesDuration(int64(skopts.SendTimeout.Sec), int64(skopts.SendTimeout.Usec)),
59-
}),
64+
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTimeout{
65+
Duration: convertToPtypesDuration(int64(skopts.SendTimeout.Sec), int64(skopts.SendTimeout.Usec)),
6066
})
67+
if err == nil {
68+
opts = append(opts, &channelzpb.SocketOption{
69+
Name: "SO_SNDTIMEO",
70+
Additional: additional,
71+
})
72+
} else {
73+
logger.Warningf("Failed to marshal socket options send timeout %+v: %v", skopts.SendTimeout, err)
74+
}
6175
}
6276
if skopts.TCPInfo != nil {
63-
additional := testutils.MarshalAny(&channelzpb.SocketOptionTcpInfo{
77+
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTcpInfo{
6478
TcpiState: uint32(skopts.TCPInfo.State),
6579
TcpiCaState: uint32(skopts.TCPInfo.Ca_state),
6680
TcpiRetransmits: uint32(skopts.TCPInfo.Retransmits),
@@ -91,10 +105,14 @@ func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOptio
91105
TcpiAdvmss: skopts.TCPInfo.Advmss,
92106
TcpiReordering: skopts.TCPInfo.Reordering,
93107
})
94-
opts = append(opts, &channelzpb.SocketOption{
95-
Name: "TCP_INFO",
96-
Additional: additional,
97-
})
108+
if err == nil {
109+
opts = append(opts, &channelzpb.SocketOption{
110+
Name: "TCP_INFO",
111+
Additional: additional,
112+
})
113+
} else {
114+
logger.Warningf("Failed to marshal socket options TCP info %+v: %v", skopts.TCPInfo, err)
115+
}
98116
}
99117
return opts
100118
}

0 commit comments

Comments
 (0)