Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: add temporary logging to LRS #3490

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions xds/internal/balancer/lrs/lrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ func (ls *lrsStore) ReportTo(ctx context.Context, cc *grpc.ClientConn, clusterNa
grpclog.Warningf("lrs: failed to create stream: %v", err)
continue
}
if err := stream.Send(&lrspb.LoadStatsRequest{
Node: node,
}); err != nil {
grpclog.Infof("lrs: created LRS stream")
req := &lrspb.LoadStatsRequest{Node: node}
grpclog.Infof("lrs: sending init LoadStatsRequest: %v", req)
if err := stream.Send(req); err != nil {
grpclog.Warningf("lrs: failed to send first request: %v", err)
continue
}
Expand All @@ -324,6 +325,7 @@ func (ls *lrsStore) ReportTo(ctx context.Context, cc *grpc.ClientConn, clusterNa
grpclog.Warningf("lrs: failed to receive first response: %v", err)
continue
}
grpclog.Infof("lrs: received first LoadStatsResponse: %+v", first)
interval, err := ptypes.Duration(first.LoadReportingInterval)
if err != nil {
grpclog.Warningf("lrs: failed to convert report interval: %v", err)
Expand Down Expand Up @@ -366,9 +368,9 @@ func (ls *lrsStore) sendLoads(ctx context.Context, stream lrsgrpc.LoadReportingS
case <-ctx.Done():
return
}
if err := stream.Send(&lrspb.LoadStatsRequest{
ClusterStats: ls.buildStats(clusterName),
}); err != nil {
req := &lrspb.LoadStatsRequest{ClusterStats: ls.buildStats(clusterName)}
grpclog.Infof("lrs: sending LRS loads: %+v", req)
if err := stream.Send(req); err != nil {
grpclog.Warningf("lrs: failed to send report: %v", err)
return
}
Expand Down
2 changes: 2 additions & 0 deletions xds/internal/client/client_loadreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ func (c *Client) ReportLoad(server string, clusterName string, loadStore lrs.Sto
cc *grpc.ClientConn
closeCC bool
)
c.logger.Infof("Starting load report to server: %s", server)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have "lrs" prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is logging with the logger, from the xds_client. It's going to have prefix "xds-client".

This is where things are getting inconsistent. I will need to refactor LRS to support multiple clusters. The logs in this PR are temporary.

if server == "" || server == c.opts.Config.BalancerName {
cc = c.cc
} else {
c.logger.Infof("LRS server is different from xDS server, starting a new ClientConn")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here? Is this expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

dopts := append([]grpc.DialOption{c.opts.Config.Creds}, c.opts.DialOpts...)
ccNew, err := grpc.Dial(server, dopts...)
if err != nil {
Expand Down