Skip to content

docs(bigtable): clarify session close, cancelRpc, and heartbeat invariants - #15000

Merged
igorbernstein2 merged 2 commits into
mainfrom
docs-clarify-session-close-and-cancel-contract
Nov 13, 2026
Merged

igorbernstein2 merged 2 commits into
mainfrom
docs-clarify-session-close-and-cancel-contract

Conversation

@igorbernstein2

Copy link
Copy Markdown
Contributor

Clarifies the Session lifecycle, cancelRpc, and server heartbeat/deadline contracts in Session and SessionImpl:

  • Fix misleading Javadoc on Session.close() (which previously described immediate abort like forceClose() rather than graceful drain via CLOSING -> WAIT_SERVER_CLOSE) and document how each SessionState is bounded.
  • Document in SessionImpl.cancelRpc() and SessionImpl.close() why currentRpc remains set after local cancellation until the server replies (the protocol does not yet have a wire cancel-vRPC message, so keeping currentRpc set prevents returning a READY session to the pool while the vRPC is still active on the server and prevents sending CloseSessionRequest while a vRPC is still in flight on the server).
  • Document in SessionImpl.checkCloseTimeout() why closeTimeout only needs to bound WAIT_SERVER_CLOSE (CLOSING only occurs while a vRPC is active on the wire, which is bounded by server heartbeats via checkHeartbeat() and the server-enforced VirtualRpcRequest.deadline).

@igorbernstein2
igorbernstein2 requested review from a team as code owners November 13, 2026 16:35

@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 enhances the documentation and inline comments in Session.java and SessionImpl.java to clarify the Session V3 protocol state transitions, graceful close behavior, RPC cancellation mechanics, and timeout handling. Specifically, it explains why a session waits in the CLOSING state during active vRPCs and details the server-side invariants bounding this state. There are no review comments, and I have no additional feedback to provide.

@igorbernstein2
igorbernstein2 merged commit b32651d into main Nov 13, 2026
208 checks passed
@igorbernstein2
igorbernstein2 deleted the docs-clarify-session-close-and-cancel-contract branch November 13, 2026 19:02
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