From 0561c78c9dcb5876a140ff7be97f0f37abc36ec8 Mon Sep 17 00:00:00 2001 From: boyce Date: Wed, 8 May 2024 02:10:31 +0800 Subject: [PATCH] client: add user-friendly error message of LB policy update timed out (#7206) --- picker_wrapper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/picker_wrapper.go b/picker_wrapper.go index bf56faa76d3d..56e8aba783f7 100644 --- a/picker_wrapper.go +++ b/picker_wrapper.go @@ -20,6 +20,7 @@ package grpc import ( "context" + "fmt" "io" "sync" @@ -117,7 +118,7 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. if lastPickErr != nil { errStr = "latest balancer error: " + lastPickErr.Error() } else { - errStr = ctx.Err().Error() + errStr = fmt.Sprintf("received context error while waiting for new LB policy update: %s", ctx.Err().Error()) } switch ctx.Err() { case context.DeadlineExceeded: