-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement request] make retryer and sleeper more flexible #121
Comments
Hi yanshenxian -- It's true, the B2StorageClientFactory doesn't make it easy to change the retry policy. Sorry. The B2StorageClientFactory is fairly new and doesn't expose all of the flexibility of the rest of the SDK. To set the B2RetryPolicy implementation to your own class with the existing code, you will need to use something like the B2StorageHttpClientBuilder and call setRetryPolicySupplier, passing a Supplier. Alternatively, if you would like to make a PR that adds setRetryPolicy() to B2StorageClientFactory, I'd be open to reviewing it. :) thanks, |
Hi yanshenxian -- Were those pointers helpful? thanks, |
@certainmagic hi thanks for your reply~ |
hi yanshenxian -- It looks like your reply got truncated somewhere along the way. ttfn, |
Hi @yanshenxian -- Just checking in... ttfn, |
sdk version: 4.0.0
The default
B2RetryPolicy
wil try max 8 attempts and each time wil sleep at least 1 second.Because hard code
sleeper.sleepSeconds(waitSeconds)
written atcom.backblaze.b2.client.B2Retryer#doRetry(java.lang.String, com.backblaze.b2.client.B2AccountAuthorizationCache, com.backblaze.b2.client.B2Retryer.RetryableCallable<T>, com.backblaze.b2.client.B2RetryPolicy)
And these classes (and some parameter classes) are package accessed.
It's not easy to change the retry behavior... 😢
The text was updated successfully, but these errors were encountered: