Comments (8)
So you think that when the RequestFuture times out then we could be orphaning the actual request that could actually continue even though we don't care about its result? That would indeed seem less than ideal.
But I wonder if it's wise to still provide a RequestFuture.get() timeout. Maybe there are other things (other than the network communication) that can cause it to take longer.
from android-galaxyzoo.
The default timeout of volley library is 2.5 second. And if it fails, it will automatically retry once at back-off multiplier 1. That means, the maximum timeout of a default volly network requests is
2.5s (first timeout) + 2.5s(back-off) + 2.5s (retry timeout) = 7.5s,
which is far more less than 20 seconds.
I didn't mean to delete Request.future(), but in addition to that, we also need to set network request's timeout separately. For example:
request.setRetryPolicy(20000);
try {
response = futureListener.get(30000, TimeUnit.MILLISECONDS);
}
So what do you think ? If you agree with this policy, I would be happy to submit a pull request of the change.
from android-galaxyzoo.
I'm happy to use the default volley timeout time (and backoff time and retry counts). They are probably well chosen. If our RequestFuture waits longer when that fails, it's no great problem as long as we don't wait too long. It seems more important to give volley enough time to do what it usually does, while not waiting forever (or for an excessively long time). It would be nice if we didn't have to mention any magic number, of course.
So, thanks, but it doesn't look like changing this would be useful.
from android-galaxyzoo.
Well, I am afraid it is hard to say that the default value is well chosen. Actually 2.5 second is too short, especially when you load some file under weak connection. Originally I was not aware of this short timeout too, but later I got so many timeout exceptions in practice, so I increased it in my project. There is no one-size-for-all answer, but I suggest to be conservative on choosing the value to fit into yours :)
Thanks,
from android-galaxyzoo.
A patch to increase the timeout slightly would be welcome even if I end up commenting it out until I see a real need for it to fix a real problem. There's a chance that this will improve things on bad connections, though bad connections just might be too bad to use at all. Thanks.
from android-galaxyzoo.
Closing this for now until there's some sign that there is a real problem here for real users.
from android-galaxyzoo.
I use default timeout. But 5 minutes left onErrorResponse not called. I used alertdialog & cancellable(false);
So this is a very bad problem for me..
How can I set timeout 10 second? I don't want to start that process again.
from android-galaxyzoo.
This is the android-galaxyzoo project, not the volley project.
from android-galaxyzoo.
Related Issues (20)
- Crash while loading translations HOT 3
- Crash in getAccountLoginDetails() during uploadOutstandingClassifications(). HOT 1
- Crash with CONNECTIVITY_CHANGE: "Error receiving broadcast Intent" HOT 1
- Incorrect classifications for goods_full and candels_2epoch HOT 25
- New subjects - what do you need to prep? HOT 2
- App is serving inactive subjects? HOT 3
- Add button "Get it on F-Droid" HOT 1
- Share the image via the Share menu item HOT 2
- Beta: Crash at startup: ava.lang.VerifyError: Rejecting class com.murrayc.galaxyzoo.app.aq because it failed compile-time verification HOT 7
- Add to F-Droid HOT 1
- Provide pure floss build flavor HOT 1
- Allow user registration in the app
- Cannot download new subjects to classify HOT 10
- Poor use of vertical screen real estate on small devices HOT 2
- No good comes from screen rotation HOT 1
- Zoom HOT 1
- Images not centered
- Cannot download new subjects to classify -- again HOT 6
- update repo for 1.72
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 android-galaxyzoo.