Skip to content

fix(bigtable): avoid triggering per-RPC credential session fallback on default call context - #14961

Merged
igorbernstein2 merged 3 commits into
mainfrom
fix-session-default-call-context-fallback
Nov 10, 2026
Merged

igorbernstein2 merged 3 commits into
mainfrom
fix-session-default-call-context-fallback

Conversation

@igorbernstein2

Copy link
Copy Markdown
Contributor

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 fix: propogate deadline to session client #14547.
  • Update SessionDeadlineTest and DivertingUnaryCallableTest to cover client-level credentials and ambient deadlines.

@igorbernstein2
igorbernstein2 requested review from a team as code owners November 10, 2026 16:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 refactors deadline extraction logic in Util.java to improve clarity and simplifies EnhancedBigtableStub by removing redundant withDefaultCallContext calls. Additionally, it adds comprehensive test coverage for ambient deadline propagation. My feedback includes a suggestion to add a defensive null check for defaultDeadline in Util.java and a recommendation to use a dedicated ScheduledExecutorService in SessionDeadlineTest.java to prevent potential resource leaks when scheduling context deadlines.

@igorbernstein2
igorbernstein2 merged commit eb06d2c into main Nov 10, 2026
208 checks passed
@igorbernstein2
igorbernstein2 deleted the fix-session-default-call-context-fallback branch November 10, 2026 19:21
mutianf added a commit that referenced this pull request Nov 11, 2026
…les and verify VirtualRpc traffic (#14963)

### Summary
- Make `bigtable-session-it` a composable Maven profile that sets
`bigtable.internal.client-config-override-use-default=true` and
`bigtable.internal.client-config-override=session_configuration {
session_diversion_configuration { global_diversion { session_load: 1.0 }
} }` so it can be combined with `bigtable-cfe-it` (`-P
bigtable-cfe-it,bigtable-session-it`) or `bigtable-directpath-it` (`-P
bigtable-directpath-it,bigtable-session-it`).
- Scope `bigtable-cfe-it` failsafe `<includes>` to
`com.google.cloud.bigtable.data.v2.it.*IT` (matching
`bigtable-directpath-it`), which includes `SessionIT` when
`bigtable-session-it` is active (and skips `SessionIT` via `Assume` when
`bigtable-session-it` is not active).
- Update `.kokoro/presubmit/bigtable-integration-session.cfg` to compose
`-P bigtable-cfe-it,bigtable-session-it,enable-verbose-grpc-logs`.
- Update `SessionIT`:
- Chain `PeerInfoCapturingInterceptor` onto any existing
`channelConfigurator` from `CloudEnv` (`REQUIRE_CFE` /
`REQUIRE_DIRECT_PATH`) instead of overwriting it.
- Assert that `readRow` and `mutateRow` actually send
`SessionRequest.virtual_rpc` messages over `OpenTable` and do not fall
back to classic `ReadRows`/`MutateRow` RPCs (previously `SessionIT` only
checked `bigtable-peer-info` headers from background `OpenTable` stream
establishment, allowing silent fallback to classic RPCs to go
undetected).
- Assert the expected `PeerInfo.TransportType`
(`TRANSPORT_TYPE_SESSION_DIRECT_ACCESS` under `REQUIRE_DIRECT_PATH`,
`TRANSPORT_TYPE_SESSION_CLOUD_PATH` under `REQUIRE_CFE`).

### Related PRs
- Depends on #14961 (expected to fail `SessionIT` on `main` until #14961
is merged).

---------

Co-authored-by: Mattie Fu <mattiefu@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants