Skip to content

Commit

Permalink
merge from master and update conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Mar 19, 2024
2 parents 93f5da6 + dadbbfa commit d3d4605
Show file tree
Hide file tree
Showing 57 changed files with 2,564 additions and 2,811 deletions.
4 changes: 2 additions & 2 deletions balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ type BuildOptions struct {
// implementations which do not communicate with a remote load balancer
// server can ignore this field.
Authority string
// ChannelzParentID is the parent ClientConn's channelz ID.
ChannelzParentID *channelz.Identifier
// ChannelzParent is the parent ClientConn's channelz channel.
ChannelzParent channelz.Identifier
// CustomUserAgent is the custom user agent set on the parent ClientConn.
// The balancer should set the same custom user agent if it creates a
// ClientConn.
Expand Down
2 changes: 1 addition & 1 deletion balancer/grpclb/grpclb_remote_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (lb *lbBalancer) newRemoteBalancerCCWrapper() error {
// Explicitly set pickfirst as the balancer.
dopts = append(dopts, grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"pick_first"}`))
dopts = append(dopts, grpc.WithResolvers(lb.manualResolver))
dopts = append(dopts, grpc.WithChannelzParentID(lb.opt.ChannelzParentID))
dopts = append(dopts, grpc.WithChannelzParentID(lb.opt.ChannelzParent))

// Enable Keepalive for grpclb client.
dopts = append(dopts, grpc.WithKeepaliveParams(keepalive.ClientParameters{
Expand Down
2 changes: 1 addition & 1 deletion balancer/leastrequest/balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func checkRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient,
}
iterations = append(iterations, iteration)
}
// Ensure the the first iteration contains all addresses in addrs.
// Ensure the first iteration contains all addresses in addrs.
for _, addr := range iterations[0] {
gotAddrCount[addr]++
}
Expand Down
2 changes: 1 addition & 1 deletion balancer/weightedroundrobin/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (s *edfScheduler) nextIndex() int {
}

// A simple RR scheduler to use for fallback when fewer than two backends have
// non-zero weights, or all backends have the the same weight, or when only one
// non-zero weights, or all backends have the same weight, or when only one
// subconn exists.
type rrScheduler struct {
inc func() uint32
Expand Down
22 changes: 11 additions & 11 deletions balancer_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper {
ccb := &ccBalancerWrapper{
cc: cc,
opts: balancer.BuildOptions{
DialCreds: cc.dopts.copts.TransportCredentials,
CredsBundle: cc.dopts.copts.CredsBundle,
Dialer: cc.dopts.copts.Dialer,
Authority: cc.authority,
CustomUserAgent: cc.dopts.copts.UserAgent,
ChannelzParentID: cc.channelzID,
Target: cc.parsedTarget,
DialCreds: cc.dopts.copts.TransportCredentials,
CredsBundle: cc.dopts.copts.CredsBundle,
Dialer: cc.dopts.copts.Dialer,
Authority: cc.authority,
CustomUserAgent: cc.dopts.copts.UserAgent,
ChannelzParent: cc.channelz,
Target: cc.parsedTarget,
},
serializer: grpcsync.NewCallbackSerializer(ctx),
serializerCancel: cancel,
Expand All @@ -100,7 +100,7 @@ func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnStat
name := gracefulswitch.ChildName(ccs.BalancerConfig)
if ccb.curBalancerName != name {
ccb.curBalancerName = name
channelz.Infof(logger, ccb.cc.channelzID, "Channel switches to new LB policy %q", name)
channelz.Infof(logger, ccb.cc.channelz, "Channel switches to new LB policy %q", name)
}
err := ccb.balancer.UpdateClientConnState(*ccs)
if logger.V(2) && err != nil {
Expand Down Expand Up @@ -132,7 +132,7 @@ func (ccb *ccBalancerWrapper) close() {
ccb.mu.Lock()
ccb.closed = true
ccb.mu.Unlock()
channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: closing")
channelz.Info(logger, ccb.cc.channelz, "ccBalancerWrapper: closing")
ccb.serializer.Schedule(func(context.Context) {
if ccb.balancer == nil {
return
Expand Down Expand Up @@ -169,7 +169,7 @@ func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer
}
ac, err := ccb.cc.newAddrConnLocked(addrs, opts)
if err != nil {
channelz.Warningf(logger, ccb.cc.channelzID, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err)
channelz.Warningf(logger, ccb.cc.channelz, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err)
return nil, err
}
acbw := &acBalancerWrapper{
Expand Down Expand Up @@ -261,7 +261,7 @@ func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) {
}

func (acbw *acBalancerWrapper) String() string {
return fmt.Sprintf("SubConn(id:%d)", acbw.ac.channelzID.Int())
return fmt.Sprintf("SubConn(id:%d)", acbw.ac.channelz.ID)
}

func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) {
Expand Down
3 changes: 3 additions & 0 deletions channelz/service/func_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
}

func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOption {
if skopts == nil {
return nil
}
var opts []*channelzpb.SocketOption
if skopts.Linger != nil {
additional, err := anypb.New(&channelzpb.SocketOptionLinger{
Expand Down
Loading

0 comments on commit d3d4605

Please sign in to comment.