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
spanner: refactor retrying #1418
Comments
Made some progress on this in https://code-review.googlesource.com/c/gocloud/+/40790, but not sure if I have the time to continue. Thought I'd record my thoughts in the meantime if someone else has more time. |
Reopening as there is still some work to do on this. |
Create a customized GAX retryer that checks for any retry information that Cloud Spanner might have returned. If Cloud Spanner did not return any retry information, a default delay is calculated by GAX and used. Updates #1418 Change-Id: I56b9ab0bc4f64ad68f19edb9d18c89c3af7995d3 Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/44172 Reviewed-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Jean de Klerk <deklerk@google.com>
Use a standard GAX retryer for resumableStreamDecoder and only retry on standard gRPC codes. Removes the custom error checks that were used by this decoder. Updates #1418. Change-Id: I8f339f31cf71fe3e5f9aebcb685b5444c8aa56b8 Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/44173 Reviewed-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jean de Klerk <deklerk@google.com>
Custom retry loops have been replaced with standard GAX retryers where applicable. All other retries are handled by GAPIC. As noted above: Removing/refactoring the assignment of gRPC codes to errors should be handled in a separate issue. |
It seems that the retry on |
Spanner should:
github.com/googleapis/gax-go/v2
for retrying, replacing all the custom logic in runRetryable and runRetryableNoWrap.codes.Aborted
only, removing entirely ourtransport is closing
,streaming terminated by RST_STREAM
, andunexpected EOF
retries.UNAVAILABLE
andUNKNOWN
). The only retrying that should happen in the manual client is retries around transactions in which the retry block (runInTransaction
) encompasses all transactional RPCs, and ABORTED causes the entire transaction to be rolled back and retried.StreamingRead
, which seems to (correctly) have retry logic aroundresumableStreamDecoder
. This retry logic should probably be replaced with something like agax.OnCodes(ABORTED, UNAVAILABLE, UNKNOWN)
rather than doing retry counting and and so on.The text was updated successfully, but these errors were encountered: