Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Jan 31, 2024
1 parent bdcd475 commit ae3d78b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion server/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (s *GrpcServer) forwardTSO(stream pdpb.PD_TsoServer) error {
cancelForward()
}

s.closeDelegateClient(lastForwardedHost)
clientConn, err := s.getDelegateClient(s.ctx, forwardedHost)
if err != nil {
tsoStreamErr = errors.WithStack(err)
Expand Down Expand Up @@ -378,6 +377,7 @@ func (s *GrpcServer) closeDelegateClient(forwardedHost string) {
return
}
client.(*grpc.ClientConn).Close()
log.Debug("close delegate client connection", zap.String("forwarded-host", forwardedHost))
}

func (s *GrpcServer) isLocalRequest(host string) bool {
Expand Down
1 change: 0 additions & 1 deletion server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,6 @@ func (s *GrpcServer) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error
cancel()
}

s.closeDelegateClient(lastForwardedSchedulingHost)
client, err := s.getDelegateClient(s.ctx, forwardedSchedulingHost)
if err != nil {
errRegionHeartbeatClient.Inc()
Expand Down

0 comments on commit ae3d78b

Please sign in to comment.