{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/3974","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/3974/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/3974/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/3974/events","html_url":"https://github.com/square/okhttp/issues/3974","id":315841405,"node_id":"MDU6SXNzdWUzMTU4NDE0MDU=","number":3974,"title":"Socket timeout","user":{"login":"hkachoria","id":38528408,"node_id":"MDQ6VXNlcjM4NTI4NDA4","avatar_url":"https://avatars0.githubusercontent.com/u/38528408?v=4","gravatar_id":"","url":"https://api.github.com/users/hkachoria","html_url":"https://github.com/hkachoria","followers_url":"https://api.github.com/users/hkachoria/followers","following_url":"https://api.github.com/users/hkachoria/following{/other_user}","gists_url":"https://api.github.com/users/hkachoria/gists{/gist_id}","starred_url":"https://api.github.com/users/hkachoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkachoria/subscriptions","organizations_url":"https://api.github.com/users/hkachoria/orgs","repos_url":"https://api.github.com/users/hkachoria/repos","events_url":"https://api.github.com/users/hkachoria/events{/privacy}","received_events_url":"https://api.github.com/users/hkachoria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2018-04-19T11:44:38Z","updated_at":"2018-06-26T02:08:22Z","closed_at":null,"author_association":"NONE","body":"OKHttp version - 3.4.2\r\non Android \r\nSome time our client is facing timeout exception.\r\n\r\nServer is available, that we verified using some other service.\r\nProblem only come for post request, Timeout increased to 200 seconds still problem exists.\r\n\r\nWe debug on server as well and noticed that request not reaching to server, network connectivity is not issue as some other service with get request works well at same time. \r\n\r\n- As soon as user switch from mobile network to wifi then all well.\r\n\r\nClient code -\r\n        OkHttpClient client = new OkHttpClient.Builder().connectTimeout(200, TimeUnit.SECONDS).\r\n                readTimeout(200, TimeUnit.SECONDS)\r\n                .writeTimeout(200, TimeUnit.SECONDS)\r\n                .followRedirects(true)\r\n                .followSslRedirects(true)\r\n                    .build();\r\n\r\nException -\r\n\r\nCaused by: java.net.SocketTimeoutException: timeout\r\n  \tat okio.Okio$4.newTimeoutException(Okio.java:227)\r\n  \tat okio.AsyncTimeout.exit(AsyncTimeout.java:284)\r\n  \tat okio.AsyncTimeout$2.read(AsyncTimeout.java:240)\r\n  \tat okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)\r\n  \tat okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)\r\n  \tat okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)\r\n  \tat okhttp3.internal.http.Http1xStream.readResponse(Http1xStream.java:186)\r\n  \tat okhttp3.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:127)\r\n  \tat okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:53)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n  \tat okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n  \tat okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n  \tat okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n  \tat okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n  \tat okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n  \tat okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)\r\n  \tat okhttp3.RealCall.execute(RealCall.java:60)\r\n  \tat com.mexel.prx.util.general.HttpUtils.postInternal(HttpUtils.java:329)\r\n  \t... 8 more\r\n  Caused by: java.net.SocketException: Socket closed\r\n  \tat java.net.SocketInputStream.socketRead0(Native Method)\r\n  \tat java.net.SocketInputStream.read(SocketInputStream.java:151)\r\n  \tat java.net.SocketInputStream.read(SocketInputStream.java:120)\r\n  \tat okio.Okio$2.read(Okio.java:138)\r\n\tat okio.AsyncTimeout$2.read(AsyncTimeout.java:236)\r\n   "},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/400153975","html_url":"https://github.com/square/okhttp/issues/3974#issuecomment-400153975","issue_url":"https://api.github.com/repos/square/okhttp/issues/3974","id":400153975,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDE1Mzk3NQ==","user":{"login":"Microhx","id":17956663,"node_id":"MDQ6VXNlcjE3OTU2NjYz","avatar_url":"https://avatars1.githubusercontent.com/u/17956663?v=4","gravatar_id":"","url":"https://api.github.com/users/Microhx","html_url":"https://github.com/Microhx","followers_url":"https://api.github.com/users/Microhx/followers","following_url":"https://api.github.com/users/Microhx/following{/other_user}","gists_url":"https://api.github.com/users/Microhx/gists{/gist_id}","starred_url":"https://api.github.com/users/Microhx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microhx/subscriptions","organizations_url":"https://api.github.com/users/Microhx/orgs","repos_url":"https://api.github.com/users/Microhx/repos","events_url":"https://api.github.com/users/Microhx/events{/privacy}","received_events_url":"https://api.github.com/users/Microhx/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T02:08:22Z","updated_at":"2018-06-26T02:08:22Z","author_association":"NONE","body":"I met the sam problem : java.net. SocketTimeoutException,\r\nversion:3.9.1"}}
{"actor":{"display_login":"Microhx"}}