Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use gapic client and rely on gax for retries
This change contains the following global changes: 1. spanner.Client uses the generated gapic client for gRPC calls, instead of a gRPC connection and a spannerpb.SpannerClient. 2. The gapic client uses the default gax retry logic. 3. Most custom retry logic has been removed, except: * retry on aborted transactions * retry for resumableStreamDecoder.next() The change also includes an in-memory Spanner server for test purposes. The server requires the user to mock the result of queries and update statements. Sessions and transactions are handled automatically. It also allows the user to register specific errors to be returned for each gRPC function. This test server makes it easier to develop test cases that verify the behavior of the client library for an entire transaction for situations that cannot easily be created in an integration test using a real Cloud Spanner instance, such as aborted transactions or temporary retryable errors. The test cases can use the standard Spanner client withouth the need to mock any of the server functions, other than specifying the results for queries and updates. Fixes #1418 and #1384 Change-Id: If0a8bbed50b512b32d73a8ef7ad74cdb1192294b Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/41131 Reviewed-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jean de Klerk <deklerk@google.com>
- Loading branch information
Showing
14 changed files
with
2,258 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.