-
Notifications
You must be signed in to change notification settings - Fork 432
impl(bigtable): save and restore Options across query plan refresh threads #15747
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
impl(bigtable): save and restore Options across query plan refresh threads #15747
Conversation
Summary of ChangesHello @scotthart, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the handling of thread-local Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly addresses a potential issue with Options propagation in asynchronous query plan refresh operations. By capturing the options when scheduling the refresh timer and restoring them within the timer's continuation using OptionsSpan, the changes ensure that the refresh logic executes with the correct context, regardless of which thread it runs on. The refactoring in DataConnectionImpl to rely on this mechanism simplifies the code by removing explicit Options passing. The implementation looks correct and robust.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15747 +/- ##
=======================================
Coverage 93.03% 93.04%
=======================================
Files 2445 2445
Lines 226049 226052 +3
=======================================
+ Hits 210313 210321 +8
+ Misses 15736 15731 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| auto refresh_fn = [this, request, current, func]() mutable { | ||
| auto refresh_fn = [this, request, func]() mutable { | ||
| auto current = google::cloud::internal::SaveCurrentOptions(); |
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.
Mostly documenting this for future reference: does this ensure that the options are preserved/available for the refresh query plan operation(which is performed on a different thread)?
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.
This just ensures that when the refresh_fn is called it uses the Options from the current thread. The save/restore Options mechanism is part of the .then lambda on the refresh deadline timer in query_plan.cc
No description provided.