-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore(bigtable): add timeouts to proxy methods #6973
Conversation
bigtable/internal/testproxy/proxy.go
Outdated
ct, _ := context.WithTimeout(ctx, btc.perOperationTimeout.AsDuration()) | ||
ctx = ct | ||
} | ||
ctx, _ = btc.timeout(ctx) |
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.
Let's add a defer cancel()
on all of these.
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.
Done.
bigtable/internal/testproxy/proxy.go
Outdated
if tc.perOperationTimeout != nil { | ||
return context.WithTimeout(ctx, tc.perOperationTimeout.AsDuration()) | ||
} | ||
return ctx, nil |
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.
return context.WithCancel(ctx)
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.
Done.
This PR applies the perOperationTimeout setting to the context object for each client call.