Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hueypark committed Mar 4, 2023
2 parents c05feed + b46bdef commit 9390057
Show file tree
Hide file tree
Showing 196 changed files with 8,578 additions and 3,219 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
18 changes: 9 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: '1.20'
- name: Checkout repo
uses: actions/checkout@v2

Expand All @@ -46,31 +46,31 @@ jobs:
matrix:
include:
- type: vet
goversion: 1.19
goversion: '1.20'

- type: tests
goversion: 1.19
goversion: '1.20'

- type: tests
goversion: 1.19
goversion: '1.20'
testflags: -race

- type: tests
goversion: 1.19
goversion: '1.20'
goarch: 386

- type: tests
goversion: 1.19
goversion: '1.20'
goarch: arm64

- type: tests
goversion: 1.18
goversion: '1.19'

- type: tests
goversion: 1.17
goversion: '1.18'

- type: extras
goversion: 1.19
goversion: '1.20'

steps:
# Setup the environment.
Expand Down
4 changes: 2 additions & 2 deletions admin/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (

v3statusgrpc "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
v3statuspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
)

Expand All @@ -55,7 +56,6 @@ type ExpectedStatusCodes struct {
func RunRegisterTests(t *testing.T, ec ExpectedStatusCodes) {
nodeID := uuid.New().String()
bootstrapCleanup, err := bootstrap.CreateFile(bootstrap.Options{
Version: bootstrap.TransportV3,
NodeID: nodeID,
ServerURI: "no.need.for.a.server",
})
Expand Down Expand Up @@ -99,7 +99,7 @@ func RunRegisterTests(t *testing.T, ec ExpectedStatusCodes) {

// RunChannelz makes a channelz RPC.
func RunChannelz(conn *grpc.ClientConn) error {
c := channelzpb.NewChannelzClient(conn)
c := channelzgrpc.NewChannelzClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()
_, err := c.GetTopChannels(ctx, &channelzpb.GetTopChannelsRequest{}, grpc.WaitForReady(true))
Expand Down
2 changes: 1 addition & 1 deletion balancer/grpclb/grpc_lb_v1/load_balancer.pb.go

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

10 changes: 7 additions & 3 deletions balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go

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

2 changes: 1 addition & 1 deletion binarylog/grpc_binarylog_v1/binarylog.pb.go

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

2 changes: 1 addition & 1 deletion channelz/grpc_channelz_v1/channelz.pb.go

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

42 changes: 26 additions & 16 deletions channelz/grpc_channelz_v1/channelz_grpc.pb.go

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

62 changes: 40 additions & 22 deletions channelz/service/func_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
durpb "github.com/golang/protobuf/ptypes/duration"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/internal/testutils"
)

func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
Expand All @@ -35,32 +34,47 @@ func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOption {
var opts []*channelzpb.SocketOption
if skopts.Linger != nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_LINGER",
Additional: testutils.MarshalAny(&channelzpb.SocketOptionLinger{
Active: skopts.Linger.Onoff != 0,
Duration: convertToPtypesDuration(int64(skopts.Linger.Linger), 0),
}),
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionLinger{
Active: skopts.Linger.Onoff != 0,
Duration: convertToPtypesDuration(int64(skopts.Linger.Linger), 0),
})
if err == nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_LINGER",
Additional: additional,
})
} else {
logger.Warningf("Failed to marshal socket options linger %+v: %v", skopts.Linger, err)
}
}
if skopts.RecvTimeout != nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_RCVTIMEO",
Additional: testutils.MarshalAny(&channelzpb.SocketOptionTimeout{
Duration: convertToPtypesDuration(int64(skopts.RecvTimeout.Sec), int64(skopts.RecvTimeout.Usec)),
}),
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTimeout{
Duration: convertToPtypesDuration(int64(skopts.RecvTimeout.Sec), int64(skopts.RecvTimeout.Usec)),
})
if err == nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_RCVTIMEO",
Additional: additional,
})
} else {
logger.Warningf("Failed to marshal socket options receive timeout %+v: %v", skopts.RecvTimeout, err)
}
}
if skopts.SendTimeout != nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_SNDTIMEO",
Additional: testutils.MarshalAny(&channelzpb.SocketOptionTimeout{
Duration: convertToPtypesDuration(int64(skopts.SendTimeout.Sec), int64(skopts.SendTimeout.Usec)),
}),
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTimeout{
Duration: convertToPtypesDuration(int64(skopts.SendTimeout.Sec), int64(skopts.SendTimeout.Usec)),
})
if err == nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "SO_SNDTIMEO",
Additional: additional,
})
} else {
logger.Warningf("Failed to marshal socket options send timeout %+v: %v", skopts.SendTimeout, err)
}
}
if skopts.TCPInfo != nil {
additional := testutils.MarshalAny(&channelzpb.SocketOptionTcpInfo{
additional, err := ptypes.MarshalAny(&channelzpb.SocketOptionTcpInfo{
TcpiState: uint32(skopts.TCPInfo.State),
TcpiCaState: uint32(skopts.TCPInfo.Ca_state),
TcpiRetransmits: uint32(skopts.TCPInfo.Retransmits),
Expand Down Expand Up @@ -91,10 +105,14 @@ func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOptio
TcpiAdvmss: skopts.TCPInfo.Advmss,
TcpiReordering: skopts.TCPInfo.Reordering,
})
opts = append(opts, &channelzpb.SocketOption{
Name: "TCP_INFO",
Additional: additional,
})
if err == nil {
opts = append(opts, &channelzpb.SocketOption{
Name: "TCP_INFO",
Additional: additional,
})
} else {
logger.Warningf("Failed to marshal socket options TCP info %+v: %v", skopts.TCPInfo, err)
}
}
return opts
}
Loading

0 comments on commit 9390057

Please sign in to comment.