GeezerVison is showing github.com — Retry ExceptionHandler could be set through ServiceOptions · Issue #1289 · googleapis/google-cloud-java
Retry ExceptionHandler could be set through ServiceOptions #1289
Description
The StorageImpl class and others use the EXCEPTION_HANDLER defined in the BaseService class when invoking runWithRetries.
The RetryParams and Clock can be set in the ServiceOptions and will be used when invoking runWithRetries, however the exception handler seems hardcoded.
Is that a definitive decision or would it be possible to have the exception handler also be passed through the options ?
Why
In order to be particularly resilient to transient errors it would be beneficial to be able to retry on a larger set of exceptions.
Activity
mziccard commented on Sep 28, 2016
Is that a definitive decision or would it be possible to have the exception handler also be passed through the options ?
We already retry all exceptions that are retryable according to service documentation (see https://cloud.google.com/storage/docs/xml-api/reference-status#standardcodes for Storage). If you believe we are missing some don't hesitate to open an issue.
In order to be particularly resilient to transient errors it would be beneficial to be able to retry on a larger set of exceptions.
Do you have an example of exceptions you would want to retry?
This is not a good idea in general. Retrying exceptions that are not marked as retryable by the service might just result in more errors (for instance you might be trying to create the same object twice). For such exceptions, I encourage to implement your own retry logic at the application level, that possibly does some checks/cleanup before retrying.
Horneth commented on Sep 28, 2016
Thanks for the answer.
I encourage to implement your own retry logic at the application level, that possibly does some checks/cleanup before retrying
That's already what we're doing and it looks a lot like what's already in the exception handler, only with some additional custom logic, so I was wondering if there was a way to leverage that and get rid of our retry layer. But I understand the purpose of the built-in retry now.
As for examples it varies but we are making a lot of requests and we sometimes hit QPS limits, or transient 500s and even 403s at times. We need to be robust to as many transient errors as possible so we need to retry on those.
Metadata
Metadata
Development
No branches or pull requestsIssue actions