GeezerVison is showing github.com — fix: propogate deadline to session client by mutianf · Pull Request #14547 · googleapis/google-cloud-java
Conversation
mutianf
commented
Sep 29, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sources of deadline, in priority order (first match wins in Util.extractDeadline):
- gRPC ambient context — set externally via Context.current().withDeadline(...)
- Per-call ApiCallContext — retry settings set by the caller on a specific futureCall invocation
- Construction-time defaultTimeout — extracted from stub-level retry settings when DivertingUnaryCallable is built; the fallback when neither of the above is present
The bug:
In the session path, the callable returned to the user was missing a withDefaultCallContext carrying the stub-level retry settings. This means the context entering DivertingUnaryCallable was not stamped with those settings.
If someone's grpc context has a longer deadline then the default, and since we missed passing in the default context (2), we never fallback to use 3, and the vrpc runs for longer then expected.
The fix adds .withDefaultCallContext(ctx.withRetrySettings(retrySettings)) after shim decoration, ensuring the stub-level retry settings are always merged into the context before it reaches DivertingUnaryCallable.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gemini-code-assist[bot] reacted with eyes emoji
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 updates EnhancedBigtableStub.java to apply default call contexts with specific retry settings to point read and mutate row callables. A critical compilation error was identified in createPointReadCallable where clientContext is referenced but not defined in the scope; it should instead be accessed via bigtableClientContext.getClientContext().
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…point reads and writes
Add three tests to EnhancedBigtableStubTest that verify the
withDefaultCallContext(withRetrySettings(...)) calls added in
createPointReadCallable and createMutateRowCallable actually propagate
the configured total timeout as a gRPC deadline to the server:
- testRetrySettingsPropagatedForPointRead: readRowCallable() path
- testRetrySettingsPropagatedForPointWrite: mutateRowCallable() path
- testRetrySettingsPropagatedForMaybePointRead: readRowsCallable() with
a single-row query, which MaybePointReadCallable routes to the
point-read callable
…ltCallContext
Replace the three retry-propagation tests with shim-capturing variants that
inject a Mockito spy BigtableClientContext returning a test Shim whose wrapper
records the ApiCallContext it receives. This proves that the outer
.withDefaultCallContext(ctx.withRetrySettings(...)) added by the fix actually
populates the context passed to the shim callable – without the fix, the wrapper
would receive null and the assertThat(shimCtx).isNotNull() assertion would fail.
Uh oh!
There was an error while loading. Please reload this page.
igorbernstein2
added a commit
that referenced
this pull request
Nov 10, 2026
…n default call context (#14961)
## Summary
- Remove the outer `.withDefaultCallContext(...)` wrapper around
`DivertingUnaryCallable` in `EnhancedBigtableStub`
(`createPointReadCallable`, `createMutateRowCallable`,
`createCheckAndMutateRowCallable`, `createReadModifyWriteRowCallable`).
Merging `defaultCallContext` before `DivertingUnaryCallable` stamped the
client-level `Credentials` onto every RPC's `CallOptions`, causing
`DivertingUnaryCallable` to treat every authenticated RPC as having a
per-RPC credential override (`per_rpc_credentials_session_fallback`) and
fall back to the classic stack.
- Update `Util.extractDeadline` so `defaultDeadline` is always used as
the fallback for `retryTotalTimeout` even when a longer ambient gRPC
`Context` deadline is present, preserving the deadline behavior from
#14547.
- Update `SessionDeadlineTest` and `DivertingUnaryCallableTest` to cover
client-level credentials and ambient deadlines.
Reviewers
sushanb
sushanb approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|