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

picker_wrapper: simplify picker error when timing out waiting for con… #8035

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

purnesh42H
Copy link
Contributor

Fixes: #7983

RELEASE NOTES: None

@@ -123,7 +123,7 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
if lastPickErr != nil {
errStr = "latest balancer error: " + lastPickErr.Error()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dfawley should we change this as well? or is it fine to mention balancer here?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is probably fine. The problem with below is not that it's mentioning LB policies, but that it's unclear to most users what might trigger an LB policy update to occur.

@purnesh42H purnesh42H added the Type: Internal Cleanup Refactors, etc label Jan 24, 2025
@purnesh42H purnesh42H added this to the 1.71 Release milestone Jan 24, 2025
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.29%. Comparing base (2fd426d) to head (ac12b67).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8035      +/-   ##
==========================================
+ Coverage   82.17%   82.29%   +0.11%     
==========================================
  Files         383      383              
  Lines       38776    38776              
==========================================
+ Hits        31864    31909      +45     
+ Misses       5585     5548      -37     
+ Partials     1327     1319       -8     
Files with missing lines Coverage Δ
picker_wrapper.go 97.08% <100.00%> (ø)

... and 27 files with indirect coverage changes

@@ -123,7 +123,7 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
if lastPickErr != nil {
errStr = "latest balancer error: " + lastPickErr.Error()
Copy link
Member

Choose a reason for hiding this comment

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

I think this is probably fine. The problem with below is not that it's mentioning LB policies, but that it's unclear to most users what might trigger an LB policy update to occur.

@@ -123,7 +123,7 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
if lastPickErr != nil {
errStr = "latest balancer error: " + lastPickErr.Error()
} else {
errStr = fmt.Sprintf("received context error while waiting for new LB policy update: %s", ctx.Err().Error())
errStr = fmt.Sprintf("received context error due to timing out waiting for connection: %s", ctx.Err().Error())
Copy link
Member

Choose a reason for hiding this comment

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

How about:

fmt.Sprinft("%v while waiting for connections to become ready", ctx.Err())

This would result in either:

rpc error: code = DeadlineExceeded desc = context deadline exceeded while waiting for connections to become ready

OR

rpc error: code = Canceled desc = context canceled while waiting for connections to become ready

For reference we used to use ctx.Err().Error() directly, which resulted in, e.g.:

rpc error: code = DeadlineExceeded desc = context deadline exceeded

@dfawley dfawley assigned purnesh42H and unassigned dfawley Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

received context error while waiting for new LB policy update: context deadline exceeded
2 participants