feat(spanner): add gax options for read/write transactions#5787
Conversation
Adds methods for configuring GAX RequestOptions for the BeginTransaction and Commit RPCs of read/write transactions. Updates googleapis#4972
There was a problem hiding this comment.
Code Review
This pull request enables configuring GAX request options (such as attempt timeouts, retry policies, and backoff policies) for both the BeginTransaction and Commit RPCs in read-write transactions. It introduces new builder methods on TransactionRunnerBuilder and ReadWriteTransactionBuilder to set these options, refactors option amendment logic, and adds comprehensive unit tests. The reviewer suggested an optimization in amend_gax_options to use std::mem::take instead of cloning GaxRequestOptions to avoid unnecessary allocations.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5787 +/- ##
========================================
Coverage 97.87% 97.88%
========================================
Files 226 226
Lines 56496 56938 +442
========================================
+ Hits 55298 55731 +433
- Misses 1198 1207 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configurable request options (begin_gax_options and commit_gax_options) for BeginTransaction and Commit RPCs in ReadWriteTransactionBuilder and ReadWriteTransaction, along with corresponding builder methods in TransactionRunnerBuilder. It also refactors amend_gax_options into a standalone helper function and adds extensive unit tests. Feedback highlights that TransactionBoundedRetryPolicy does not delegate on_throttle to its inner policy, which would cause custom throttling behaviors to be silently ignored, and suggests implementing delegation for on_throttle.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds configurable GAX request options (including timeouts, retry policies, and backoff policies) for the BeginTransaction and Commit RPCs in read-write transactions. It introduces several builder methods to TransactionRunnerBuilder and ReadWriteTransactionBuilder, refactors GAX options amendment, and adds comprehensive unit tests. Feedback is provided to improve the TransactionBoundedRetryPolicy's remaining_time implementation so that it respects any shorter timeout defined by the wrapped inner retry policy.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configurable GAX request options (such as attempt timeouts, retry policies, and backoff policies) for both the BeginTransaction and Commit RPCs within read-write transactions. It updates ReadWriteTransactionBuilder and TransactionRunnerBuilder with fluent builder methods to set these options, refactors the GAX options amendment logic to correctly respect and cap timeouts based on the transaction deadline, and adds comprehensive unit tests to verify the new behaviors. No review comments were provided, and the implementation is clean and idiomatic.
Adds methods for configuring GAX RequestOptions for the BeginTransaction and Commit RPCs of read/write transactions.
Updates #4972