Skip to content

Commit 25efed9

Browse files
committed
Review comments #2.
1 parent 302134e commit 25efed9

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

balancer/rls/internal/balancer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ type rlsBalancer struct {
4848
// Mutex protects all the state maintained by the LB policy.
4949
// TODO(easwars): Once we add the cache, we will also have another lock for
5050
// the cache alone.
51-
mu sync.Mutex
52-
lbCfg *lbConfig // Most recently received service config.
53-
rlsCC *grpc.ClientConn // ClientConn to the RLS server.
54-
rlsClient *rlsClient // RLS client wrapper.
51+
mu sync.Mutex
52+
lbCfg *lbConfig // Most recently received service config.
53+
rlsCC *grpc.ClientConn // ClientConn to the RLS server.
54+
rlsC *rlsClient // RLS client wrapper.
5555

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

@@ -185,7 +185,7 @@ func (lb *rlsBalancer) updateControlChannel(newCfg *lbConfig) {
185185
lb.rlsCC.Close()
186186
}
187187
lb.rlsCC = cc
188-
lb.rlsClient = newRLSClientFunc(cc, lb.opts.Target.Endpoint, timeout)
188+
lb.rlsC = newRLSClientFunc(cc, lb.opts.Target.Endpoint, timeout)
189189
}
190190

191191
func dialCreds(opts balancer.BuildOptions) grpc.DialOption {

balancer/rls/internal/client.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ const grpcTargetType = "grpc"
4343
// throttling and asks this client to make an RPC call only after checking with
4444
// the throttler.
4545
type rlsClient struct {
46-
// The clientConn to the RLS server is owned by the RLS LB policy.
47-
cc *grpc.ClientConn
4846
stub rlspb.RouteLookupServiceClient
4947
// origDialTarget is the original dial target of the user and sent in each
5048
// RouteLookup RPC made to the RLS server.
@@ -56,7 +54,6 @@ type rlsClient struct {
5654

5755
func newRLSClient(cc *grpc.ClientConn, dialTarget string, rpcTimeout time.Duration) *rlsClient {
5856
return &rlsClient{
59-
cc: cc,
6057
stub: rlspb.NewRouteLookupServiceClient(cc),
6158
origDialTarget: dialTarget,
6259
rpcTimeout: rpcTimeout,

0 commit comments

Comments
 (0)