Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Spanner): retry logic of ExecuteStreamingSql #6149

Merged
merged 1 commit into from
May 3, 2023

Conversation

vishwarajanand
Copy link
Contributor

Potentially fixes #5880, where users are seeing ServiceException in ExecuteStreamingSql.

Currently retry is performed till default 3 attempts, if each of these satisfy:

  1. resumeToken is present
  2. ServiceException is thrown
  3. Exception code is Grpc\STATUS_UNAVAILABLE

Per the fixes done in other languages Node and comment from @olavloite , it seems we should retry by below logic (point # 1 above becomes):

  1. No results have been yielded OR a resumeToken is present

Tests

Added UTs which mock the ServiceExceptions with/o the resumeTokens.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 1, 2023
@vishwarajanand vishwarajanand added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label May 1, 2023
@vishwarajanand vishwarajanand marked this pull request as ready for review May 1, 2023 21:29
@vishwarajanand vishwarajanand requested review from a team as code owners May 1, 2023 21:29
@bshaffer bshaffer merged commit fbd16a8 into googleapis:main May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[spanner] : STATUS_UNAVAILABLE isn't retried in some cases in Result->rows()
2 participants