Skip to content

Commit

Permalink
Review comments #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Apr 23, 2020
1 parent 05088f8 commit a535bdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 6 additions & 6 deletions balancer/rls/internal/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ type rlsBalancer struct {
// Mutex protects all the state maintained by the LB policy.
// TODO(easwars): Once we add the cache, we will also have another lock for
// the cache alone.
mu sync.Mutex
lbCfg *lbConfig // Most recently received service config.
rlsCC *grpc.ClientConn // ClientConn to the RLS server.
rlsClient *rlsClient // RLS client wrapper.
mu sync.Mutex
lbCfg *lbConfig // Most recently received service config.
rlsCC *grpc.ClientConn // ClientConn to the RLS server.
rlsC *rlsClient // RLS client wrapper.

ccUpdateCh chan *balancer.ClientConnState
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func (lb *rlsBalancer) updateControlChannel(newCfg *lbConfig) {
// This is the case where only the timeout has changed. We will continue
// to use the existing clientConn. but will create a new rlsClient with
// the new timeout.
lb.rlsClient = newRLSClientFunc(lb.rlsCC, lb.opts.Target.Endpoint, timeout)
lb.rlsC = newRLSClientFunc(lb.rlsCC, lb.opts.Target.Endpoint, timeout)
return
}

Expand All @@ -185,7 +185,7 @@ func (lb *rlsBalancer) updateControlChannel(newCfg *lbConfig) {
lb.rlsCC.Close()
}
lb.rlsCC = cc
lb.rlsClient = newRLSClientFunc(cc, lb.opts.Target.Endpoint, timeout)
lb.rlsC = newRLSClientFunc(cc, lb.opts.Target.Endpoint, timeout)
}

func dialCreds(opts balancer.BuildOptions) grpc.DialOption {
Expand Down
3 changes: 0 additions & 3 deletions balancer/rls/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ const grpcTargetType = "grpc"
// throttling and asks this client to make an RPC call only after checking with
// the throttler.
type rlsClient struct {
// The clientConn to the RLS server is owned by the RLS LB policy.
cc *grpc.ClientConn
stub rlspb.RouteLookupServiceClient
// origDialTarget is the original dial target of the user and sent in each
// RouteLookup RPC made to the RLS server.
Expand All @@ -56,7 +54,6 @@ type rlsClient struct {

func newRLSClient(cc *grpc.ClientConn, dialTarget string, rpcTimeout time.Duration) *rlsClient {
return &rlsClient{
cc: cc,
stub: rlspb.NewRouteLookupServiceClient(cc),
origDialTarget: dialTarget,
rpcTimeout: rpcTimeout,
Expand Down

0 comments on commit a535bdb

Please sign in to comment.