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

chore(bigtable): add timeouts to proxy methods #6973

Merged
merged 3 commits into from Nov 1, 2022

Conversation

telpirion
Copy link
Contributor

This PR applies the perOperationTimeout setting to the context object for each client call.

@telpirion telpirion requested review from enocom and a team as code owners November 1, 2022 19:24
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigtable Issues related to the Bigtable API. labels Nov 1, 2022
ct, _ := context.WithTimeout(ctx, btc.perOperationTimeout.AsDuration())
ctx = ct
}
ctx, _ = btc.timeout(ctx)
Copy link
Member

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.

See https://stackoverflow.com/a/44394873/927514.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if tc.perOperationTimeout != nil {
return context.WithTimeout(ctx, tc.perOperationTimeout.AsDuration())
}
return ctx, nil
Copy link
Member

Choose a reason for hiding this comment

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

return context.WithCancel(ctx)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@telpirion telpirion requested a review from enocom November 1, 2022 21:21
@telpirion telpirion merged commit 5d2dc01 into main Nov 1, 2022
@telpirion telpirion deleted the bigtable-testproxy-timeouts branch November 1, 2022 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants