Skip to content

Commit 62bdb10

Browse files
authored
refactor(spanner): decouple read-only transactions from async result sets (#14902)
Decouple multi-use read-only transactions from internal async result set implementation details by introducing a dedicated lifecycle callback. Key improvements in this change: - Replaces the anonymous subclass in read-only transactions with a clean callback that signals when an asynchronous query either begins execution or is closed without starting. - Lazily resolves the underlying query stream so that closing an async query before it begins execution no longer starts the query or opens an RPC stream, preventing unnecessary network calls and session allocations. - Permits safe inspection of query statistics and metadata after a result set has been closed. - Adds comprehensive unit tests for the decoupled lifecycle, post-close inspections, and closed-state error handling.
1 parent 9f4a76a commit 62bdb10

3 files changed

Lines changed: 620 additions & 79 deletions

File tree

0 commit comments

Comments
 (0)