Repository navigation
Fix Spanner cursor handling of mid-stream errors - #19089
rahulcomet wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the _fetch method in the Spanner DB-API cursor to handle aborted transactions by retrying the transaction and restoring the cursor state from the replayed cursor. It also ensures exceptions are explicitly re-raised during fetch operations. The unit tests have been updated and expanded to verify these behaviors, including testing cursor replay and exception propagation. There are no review comments, so I have no feedback to provide.
3ca8721 to
fed518a
Compare
|
This PR does correctly identify a problem with how dbapi cursors handle errors, but it is not complete. I will create separate PRs to fix these issues. |
Summary
Raise mid-stream fetch errors so callers can detect incomplete Spanner query results. After a successful read-write transaction retry, resume from the replayed cursor without repeating rows already returned.
Fixes #19079
Testing
The new regression tests failed before the fix and passed afterward. All 271 DB-API unit tests and 112 mock-server tests passed. The broader unit suite had failures that also reproduced with the original cursor code.