Comments (3)
In general, I'd prefer to avoid a patch to BasicNetwork that attempts retries in new situations by default. However, it's fine with me if the change is reasonable and gated by something that is opt-in.
For example, you can see:
where we added Request#setShouldRetryServerErrors. If true, 5xx errors will be passed to the RetryPolicy as you describe. But it's not true by default, so the prior behavior is retained if you take no action.
So the above change should actually take care of retrying most instances of ServerError. The only exception I see is a 3xx "error" which is actually a redirect request, so it's not clear to me why you'd want to retry these. So does setShouldRetryServerErrors take care of your needs?
NetworkError should already be hitting any RetryPolicy implementation that is attached to the request:
So AFAIK, the only possible delta you'd be asking for here would be retrying on 3xx errors... if there's a valid reason to do that, I'm willing to hear it, but it seems a bit peculiar to me.
from volley.
Thanks. I agree that it doesn't make sense to retry on 3xx errors. Actually, it's the NoConnectionError errors I was hoping to retry on, not the ServerErrors:
We have an app that gathers a bunch of data on the UI from users who tend to wander around a building in which there's spotty Wi-Fi connectivity. We'd like to fire off requests to Volley safe in the knowledge that if we're not actually connected to the internet right now, we'll get a retry later on. I'd imagine that the same need would apply to consumer apps using mobile data.
Would a setShouldRetryNoConnectionErrors() flag, defaulting to off, be generally useful?
from volley.
Sorry, I realise now that the backoff implemented with the retry policy in Volley is about timeouts, not resending a request after some delay. You're waiting successively longer for a response, but you're not resending a request after some delay. It's the resend after a delay I was looking for, so I've implemented that without extending anything in Volley. Closing this.
from volley.
Related Issues (20)
- The JsonObjectRequest and JsonArrayRequest don't support 204: No Content HOT 5
- Unexpected response code 511 for HOT 1
- Support digest authentication HOT 2
- Type com.android.volley.Cache$Entry is defined multiple times HOT 1
- Caused by: com.android.tools.r8.utils.AbortException: Error: Program type already present: com.google.android.youtube.player.YouTubeApiServiceUtil HOT 1
- Volley unable to parse dateStr HOT 1
- setPriority() for Request HOT 1
- E/Volley: [18667] NetworkUtility.shouldRetryException: Unexpected response code 403 HOT 1
- -
- Com.android.volley.2015.05.28.jar HOT 1
- Support Proxy functionality HOT 1
- Volley: [5311] NetworkUtility.logSlowRequests: HTTP response for request=<[ ] HOT 3
- NetworkUtility.logSlowRequests: HTTP response for request=<[ ] https://www.google.com/ 0xd61ac103 NORMAL 1> [lifetime=6472], [size=159525], [rc=200], [retryCount=1]
- Fix nullability issues in Kotlin sample code HOT 4
- Pagination HOT 1
- Getting E/Volley: [19618] NetworkDispatcher.processRequest: Unhandled exception HOT 4
- pls rply me what can i do for this HOT 1
- Potential debug logging even when DEBUG is False HOT 6
- ConcurrentModificationException on cancel HOT 1
- App Crashed on Android version 4.3 java.lang.NoClassDefFoundError: com.android.volley.toolbox.Volley HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volley.