impl(v3): reduce GAPIC default retry policy duration to 10 minutes from 30 minutes#15958
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 implements a significant change by uniformly adjusting the default retry policy duration for all GAPIC services from 30 minutes to 10 minutes. This modification aims to improve the responsiveness of client applications by reducing the maximum time spent on retrying operations, potentially leading to faster failure detection and more efficient resource utilization. Highlights
Changelog
Activity
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.
Code Review
This pull request reduces the default retry policy duration from 30 minutes to 10 minutes for GAPIC clients. The change is correctly implemented in the generator, and the generated files have been updated accordingly. This is a good change for consistency. I have one suggestion to improve the code's maintainability by removing a magic number.
| options.set<$product_namespace$::$retry_policy_name$Option>( | ||
| $product_namespace$::$limited_time_retry_policy_name$( | ||
| std::chrono::minutes(30)).clone()); | ||
| std::chrono::minutes(10)).clone()); |
There was a problem hiding this comment.
To improve readability and maintainability, it's better to avoid magic numbers. Please consider defining a constexpr for the 10-minute duration, similar to how kBackoffScaling is defined nearby. This aligns with the Google C++ Style Guide's preference for named constants over magic numbers.
For example, you could add this before the if statement:
auto constexpr kDefaultRetryDuration = std::chrono::minutes(10);
And then use it here:
kDefaultRetryDuration).clone());
References
- The Google C++ Style Guide recommends using named constants (like
constexprvariables) instead of magic numbers to improve code clarity and maintainability. (link)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prepare-for-v3.0.0 #15958 +/- ##
======================================================
- Coverage 92.63% 92.63% -0.01%
======================================================
Files 2334 2334
Lines 214633 214633
======================================================
- Hits 198833 198825 -8
- Misses 15800 15808 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fa8874e
into
googleapis:prepare-for-v3.0.0
This change is