{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/2756","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/2756/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/2756/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/2756/events","html_url":"https://github.com/square/okhttp/issues/2756","id":168129965,"number":2756,"title":"okhttp 3.4.1will go endless loop,when there is a IOException(\"shutdown\")","user":{"login":"leokelly","id":5608966,"avatar_url":"https://avatars.githubusercontent.com/u/5608966?v=3","gravatar_id":"","url":"https://api.github.com/users/leokelly","html_url":"https://github.com/leokelly","followers_url":"https://api.github.com/users/leokelly/followers","following_url":"https://api.github.com/users/leokelly/following{/other_user}","gists_url":"https://api.github.com/users/leokelly/gists{/gist_id}","starred_url":"https://api.github.com/users/leokelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leokelly/subscriptions","organizations_url":"https://api.github.com/users/leokelly/orgs","repos_url":"https://api.github.com/users/leokelly/repos","events_url":"https://api.github.com/users/leokelly/events{/privacy}","received_events_url":"https://api.github.com/users/leokelly/received_events","type":"User","site_admin":false},"labels":[{"id":9998865,"url":"https://api.github.com/repos/square/okhttp/labels/bug","name":"bug","color":"fc2929","default":true},{"id":305935479,"url":"https://api.github.com/repos/square/okhttp/labels/needs%20info","name":"needs info","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/square/okhttp/milestones/17","html_url":"https://github.com/square/okhttp/milestones/3.5","labels_url":"https://api.github.com/repos/square/okhttp/milestones/17/labels","id":1460537,"number":17,"title":"3.5","description":"Goal: fancy joining & canceling","creator":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":23,"state":"open","created_at":"2015-12-15T01:44:49Z","updated_at":"2016-10-24T22:05:06Z","due_on":"2016-10-31T00:00:00Z","closed_at":null},"comments":16,"created_at":"2016-07-28T15:48:10Z","updated_at":"2016-11-04T16:10:21Z","closed_at":null,"body":"here is how it go endless loop:\nin file RetryAndFollowUpInterceptor.java \n\n```\npublic Response intercept(Chain chain) throws IOException {\n\nRequest request = chain.request();\nstreamAllocation = new StreamAllocation(\n    client.connectionPool(), createAddress(request.url()));\nint followUpCount = 0;\nResponse priorResponse = null;\nwhile (true) {\n  if (canceled) {\n    streamAllocation.release();\n    throw new IOException(\"Canceled\");\n  }\n\n  Response response = null;\n  boolean releaseConnection = true;\n  try {\n    response = ((RealInterceptorChain) chain).proceed(request, streamAllocation, null, null);\n    releaseConnection = false;\n  } catch (RouteException e) {\n    // The attempt to connect via a route failed. The request will not have been sent.\n    if (!recover(e.getLastConnectException(), true, request)) throw e.getLastConnectException();\n    releaseConnection = false;\n    continue;\n  } catch (IOException e) {\n    // An attempt to communicate with a server failed. The request may have been sent.\n    if (!recover(e, false, request)) throw e;\n    releaseConnection = false;\n    continue;\n  } finally {\n    // We're throwing an unchecked exception. Release any resources.\n    if (releaseConnection) {\n      streamAllocation.streamFailed(null);\n      streamAllocation.release();\n    }\n  }\n```\n\nwhen there is a  IOException(\"shutdown\") when execute \n`response = ((RealInterceptorChain) chain).proceed(request, streamAllocation, null, null);`\nit will go into catch block,and judge if can recover,`recover(e, false, request)` unfortunately recover() return true,so it will continue and go endless loop\n"},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/258474853","html_url":"https://github.com/square/okhttp/issues/2756#issuecomment-258474853","issue_url":"https://api.github.com/repos/square/okhttp/issues/2756","id":258474853,"user":{"login":"kenyee","id":586670,"avatar_url":"https://avatars.githubusercontent.com/u/586670?v=3","gravatar_id":"","url":"https://api.github.com/users/kenyee","html_url":"https://github.com/kenyee","followers_url":"https://api.github.com/users/kenyee/followers","following_url":"https://api.github.com/users/kenyee/following{/other_user}","gists_url":"https://api.github.com/users/kenyee/gists{/gist_id}","starred_url":"https://api.github.com/users/kenyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenyee/subscriptions","organizations_url":"https://api.github.com/users/kenyee/orgs","repos_url":"https://api.github.com/users/kenyee/repos","events_url":"https://api.github.com/users/kenyee/events{/privacy}","received_events_url":"https://api.github.com/users/kenyee/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T16:10:21Z","updated_at":"2016-11-04T16:10:21Z","body":"From more testing, I found that if the network gets crappy enough (if you leave CharlesSSL at 50% and keep trying to get your app to load stuff over the network when Charles gives you an unstable network), the network stack gets stuck w/ these still:\r\n  Caused by: java.io.IOException: shutdown\r\n at okhttp3.internal.framed.FramedConnection.newStream(FramedConnection.java:238)\r\nRetrofit then gets stuck as before...takes longer now so initial testing didn't show this...the fix definitely helped."}}
{"actor":{"display_login":"kenyee"}}