-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
connectTimeout more than 30 seconds does not work for okhttp #5912
Comments
I can't reproduce, answered on https://stackoverflow.com/questions/60874223/connecttimeout-more-than-30-seconds-does-not-work-for-okhttp/60913612#60913612 |
I have the same issue, com.squareup.okhttp3:okhttp:3.12.0. My requests seem to exit after 30 sec, but no exception is thrown. On android. |
@chriswoodle If you can provide a reproducible test case we can investigate, otherwise I suggest discussing on the stackoverflow question. |
@yschimke I can put something together, It's somewhat involved though, Nodejs, ngrok and an android app. |
@yschimke I put something together, It's somewhat involved though, Nodejs, ngrok and an android app. https://github.com/chriswoodle/okhttp-issue Using com.squareup.okhttp3:okhttp:3.12.0, since this app must target api lvel 17. I've tested the node express server using postman to confirm that it is not timing out requests. I''ve tested setting the okhttpclient timeout to 15 sec, and that correctly throws an exception. However, with the timeout set to anything more than 30 sec. 30 sec after making a request the following comes back.
Here are some android logs if they are helpful. Let me know if I can do anything to help or test. Thanks. |
If your server is returning this error then there I not much OkHttp can do. |
That response is not from the server. It is however returned by the okhttpclient call. Maybe there is some other network issue with my hardware, I just tested in an emulator and there is no issue. |
Actually It looks like this was a network proxy issue and my request was being timed out by something else. Thank you for your help. |
I am trying to set connectTimeout to 2 minutes, but still the tries fails after 30 seconds only.
My client looks like this:
client = new OkHttpClient.Builder()
.callTimeout(2, TimeUnit.MINUTES)
.connectTimeout(2, TimeUnit.MINUTES)
.writeTimeout(2, TimeUnit.MINUTES)
.readTimeout(2, TimeUnit.MINUTES)
.build();
public Call callReq(Callback callback) {
}
The failure response of this call I am receiving in 30 seconds. I wanted that to wait for 2 minutes. It works if I reduce the timeout to 15 seconds.
The text was updated successfully, but these errors were encountered: