Repository navigation
fix(bigtable): remove shadow attemptSettings from MutateRowsAttemptCallable - #15045
Merged
igorbernstein2 merged 3 commits intoNov 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the retry mechanism in MutateRowsAttemptCallable by replacing RetryAlgorithm<MutateRowsRequest> with RetryAlgorithm<MutateRowsAttemptResult> and delegating retry decisions to shouldRetryBasedOnResult. It also adds new tests to verify partial success handling and per-call retry settings overrides. The feedback suggests adding a defensive null check for retryAlgorithm in the constructor, appending throws Exception to the new test method signature, and applying a timeout with specific exception handling on the .get() call to prevent tests from hanging.
mutianf
approved these changes
Nov 17, 2026
igorbernstein2
deleted the
fix-mutaterows-remove-shadow-attempt-settings
branch
November 17, 2026 16:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MutateRowsAttemptCallablepreviously maintained a shadowthis.attemptSettingsfield initialized viaretryAlgorithm.createFirstAttempt(null)that was only updated inhandleAttemptErrorand never inhandleAttemptSuccess, separate fromexternalFuture.getAttemptSettings()managed by GAX'sBasicRetryingFuture.This caused three issues:
handleAttemptSuccess) were followed by an RPC-level failure (handleAttemptError),this.attemptSettingslagged behind the actual attempt count tracked byexternalFuture.RetrySettingsoverrides ignored on RPC-level errors: Becausethis.attemptSettingswas created and advanced withRetryingContext = null, per-callRetrySettingsoverrides (such as a largermaxAttemptsonApiCallContext) were ignored inhandleAttemptError, prematurely marking entries as permanent failures and aborting retries at the stub's defaultmaxAttempts.isRetryable()and tracer reporting on retry exhaustion: EvaluatingTimedAttemptSettingsinsidehandleAttemptErrorflippedMutateRowsException.isRetryable()tofalseon the final attempt (inconsistent withhandleAttemptSuccessand GAX'sApiException.isRetryable()contract, and causingBasicRetryingFutureto recordtracer.attemptPermanentFailureinstead oftracer.attemptFailedRetriesExhausted).Changes
this.attemptSettingsfield fromMutateRowsAttemptCallable.handleAttemptError, check result-based retryability (retryAlgorithm.getResultAlgorithm()) withcallContext, leavingTimedAttemptSettings(maxAttemptsandtotalTimeout) tracking and enforcement to the parentRetryingFuture.MutateRowsAttemptCallableTestcovering partial entry failure followed by RPC-level failure and per-callRetrySettings(maxAttempts) overrides.