Git Product home page Git Product logo

Comments (8)

murraycu avatar murraycu commented on May 29, 2024

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.

stream101 avatar stream101 commented on May 29, 2024

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.

murraycu avatar murraycu commented on May 29, 2024

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.

stream101 avatar stream101 commented on May 29, 2024

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.

murraycu avatar murraycu commented on May 29, 2024

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.

murraycu avatar murraycu commented on May 29, 2024

Closing this for now until there's some sign that there is a real problem here for real users.

from android-galaxyzoo.

AhmadullahSaikat avatar AhmadullahSaikat commented on May 29, 2024

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.

murraycu avatar murraycu commented on May 29, 2024

This is the android-galaxyzoo project, not the volley project.

from android-galaxyzoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.