-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix hang when local topo was down #7278
fix hang when local topo was down #7278
Conversation
1fde084
to
32c8a64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine except for the one comment.
go/vt/srvtopo/resilient_server.go
Outdated
@@ -308,7 +310,8 @@ func (server *ResilientServer) GetSrvKeyspaceNames(ctx context.Context, cell str | |||
server.counts.Add(errorCategory, 1) | |||
if entry.insertionTime.IsZero() { | |||
log.Errorf("GetSrvKeyspaceNames(%v, %v) failed: %v (no cached value, caching and returning error)", ctx, cell, err) | |||
|
|||
} else if strings.Contains(err.Error(), "deadline exceeded") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be better to check
newCtx.Err() == context.DeadlineExceeded
instead of checking for the error string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, done
Signed-off-by: JohnnyThree <[email protected]>
32c8a64
to
ebd8c60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
when local cell topo server is down, all commands related with function GetSrvKeyspaceNames are hanging
Added topo timeout and when local cell topo is broken , will use cache instead , make sure not too much effect on vtgate
Signed-off-by: JohnnyThree [email protected]
Description
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: