Skip to content

Commit

Permalink
feat: Add in-stream retry logic for retryable and quota errors (#2243)
Browse files Browse the repository at this point in the history
* Add retry logic.  TODO: get exponential retry algorithm setup

* Attach exponential retry strategy to each AppendRequestAndResponse

* Add changes to fake server to facilitate retry tests

* Add basic default and exclusive internal/quota error retries

* fix responsesToIgnore bug, add tests, remove logs

* Add more tests, reformat

* Add more tests

* Fix schema error test, retry config

* Cleanup changes, add back logs

* Add newline at EOF

* Run format

* PR feedback

* PR feedback

* Use RetrySettings in StreamWriter

* Add RetrySettings to JsonStreamWriter

* Run format

* Update clirr ignored differences; new additions never shipped

* Disable retry during multiplexing

* Throw exception if connection pool is enabled and retry settings are provided.

* Run format

* Combine retriable error checks

* Add comments, make retry settings non-static

* Set retry fields to final

* Run format

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Evan Greco <egreco@google.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 6, 2023
1 parent 5df548a commit 6435a04
Show file tree
Hide file tree
Showing 11 changed files with 930 additions and 59 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.23.0')
implementation platform('com.google.cloud:libraries-bom:26.24.0')
implementation 'com.google.cloud:google-cloud-bigquerystorage'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.42.0'
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.43.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.42.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.43.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -220,7 +220,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquerystorage/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquerystorage.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.42.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.43.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
15 changes: 15 additions & 0 deletions google-cloud-bigquerystorage/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,20 @@
<differenceType>1001</differenceType>
<className>com/google/cloud/bigquery/storage/v1/StreamConnection</className>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigquery/storage/v1/StreamWriter$Builder</className>
<method>com.google.cloud.bigquery.storage.v1.StreamWriter$Builder setMaxRetryNumAttempts(int)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigquery/storage/v1/StreamWriter$Builder</className>
<method>com.google.cloud.bigquery.storage.v1.StreamWriter$Builder setRetryMultiplier(double)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigquery/storage/v1/StreamWriter$Builder</className>
<method>com.google.cloud.bigquery.storage.v1.StreamWriter$Builder setRetryFirstDelay(org.threeten.bp.Duration)</method>
</difference>
</differences>

0 comments on commit 6435a04

Please sign in to comment.