Skip to content
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

Error 0, what does exactly mean? #139

Open
cutiko opened this issue Mar 21, 2016 · 5 comments
Open

Error 0, what does exactly mean? #139

cutiko opened this issue Mar 21, 2016 · 5 comments

Comments

@cutiko
Copy link

cutiko commented Mar 21, 2016

Greetings

At first I thought error 0 was no internet connection cause I had it when I test my app in offline mode.
But now Im getting while connected to internet.

What does error 0 actually means?

@cutiko
Copy link
Author

cutiko commented Mar 23, 2016

Greetings

After a lot of debugging we figure it out what erro 0 ment in our case, it means:

java.net.SocketTimeoutException

We found out about it using AppDynamics. I dont recommend app dynamics at all, my compile time when from 7 seconds to 1 min and a half when added, but at least, we now know what it is.

There is another part on this problem, some times error 0 can be a time out but it wasnt a time out for the server. The request was processed in the server but it took to long so before the success form the server came back the time out happened.

We are trying to fix this by doing some tweaks, still using the same good WASP. For posting, we are increase timeout but no retrys, that way if the post fail after a long time out, it did actually failed, or if it was timeout but the request was ok in the server, then in the next GET you should have the correct object (or at least dont post it twice in the server). For GETs we are increasing the timeout and using a retry policy of 3, and a multiplier by 2. This way if the response is too long for getting it the first time the second time will wait double and the third time even more, if the server didnt response on the third retry then there is a problem and something else must be improved.

Wasp is a great library, I just hope to help by sharing what we are going through now.

@orhanobut
Copy link
Owner

Hi @cutiko
I'll try to spend some more time on wasp, on the other hand I would be more happy with pull requests as well. That would make the things faster.

@cutiko
Copy link
Author

cutiko commented Mar 26, 2016

Hello @orhanobut

Thanks, we really like this library.

I have to shamefully admit Im noob, sorry Im not good enough for fixing something as complex as this :( But Im trying to contribute as much as I can with what have come out in our process.

@ergunkocak
Copy link

Hi @cutiko ,

I love wasp too ;) How did you implement separate timeouts for posts and gets?

Regards

@cutiko
Copy link
Author

cutiko commented Apr 27, 2016

Hello @ergunkocak

Create 2 different interceptors would be the straight forward path
https://github.com/orhanobut/wasp/wiki/Request-interceptor

If you create a method that return an Interceptor then you can just call it. Maybe using a singleton if the app post/get in a lot of places.

By example if you define your interface as "WaspInterface"

Then the method should be:

public WaspInterface () {
//create the interceptor
return myWaspInterface }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants