Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
spanner: cannot wrap error for ReadWriteTransaction #1223
spanner client uses spanner.Error for error inside library and spanner server. ReadWriteTransaction assumes spanner.Error is returned when an error happens so it gets reasons of the error and retry info from grpc status and trailer. It is an explict value. If we wraps the error before returning into ReadWriteTransaction, it cannot get the reasons from the error.
This is related to #1215, but probably we have some options to fix this.
I want to wrap errors happened inside ReadWriteTransaction like this.
There are problems to wrap errors.
The error handling inside ReadWriteTransaction uses
The second problem is backoff for retry. When abort happens, ReadWriteTransaction tries to retry with backoff. The backoff delays respect
I want at least to make the delays configurable for retry by setting the default backoff (option 2). Or implements an interface to pass trailers in order to ReadWriteTransaction properly sees RetryInfo from wrraped errors (option 1).