datastore: don't retry on DEADLINE_EXCEEDED
Per this error should not be retried by
the client.
Fixes
@@ -113,6 +113,8 @@ func shouldRetry(err error) bool {
if !ok {
return false
}
- // See https://cloud.google.com/datastore/docs/concepts/errors.
- return s.Code() == codes.Unavailable || s.Code() == codes.DeadlineExceeded
+ // Only retry on UNAVAILABLE as per https://aip.dev/194. Other errors from
+ // https://cloud.google.com/datastore/docs/concepts/errors may be retried
+ // by the user if desired, but are not retried by the clientg.
+ return s.Code() == codes.Unavailable
}
