{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/3146","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/3146/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/3146/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/3146/events","html_url":"https://github.com/square/okhttp/issues/3146","id":204354325,"number":3146,"title":"java.net.SocketTimeoutException from HTTP/2 connection leaves dead okhttp clients in pool","user":{"login":"kenyee","id":586670,"avatar_url":"https://avatars2.githubusercontent.com/u/586670?v=4","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},"labels":[{"id":9998865,"url":"https://api.github.com/repos/square/okhttp/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/square/okhttp/milestones/22","html_url":"https://github.com/square/okhttp/milestone/22","labels_url":"https://api.github.com/repos/square/okhttp/milestones/22/labels","id":2183001,"number":22,"title":"3.10","description":"","creator":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars3.githubusercontent.com/u/133019?v=4","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":43,"closed_issues":1,"state":"open","created_at":"2016-12-07T23:37:03Z","updated_at":"2017-09-08T18:22:02Z","due_on":"2017-10-31T07:00:00Z","closed_at":null},"comments":23,"created_at":"2017-01-31T16:46:25Z","updated_at":"2017-09-13T18:45:47Z","closed_at":null,"author_association":"NONE","body":"Tried writing a unit test w/ TestButler on Android w/ no luck, so I'll write up the steps to reproduce this and include some sample code.  This happens if you connect to an HTTP/2 server and your network goes down while the okhttp client is connected to it:\r\n1) create an okhttp client\r\n2) tell it to read from the HTTP/2 server\r\n3) bring the network down\r\n4) tell it to read from the HTTP/2 server (it'll get a SocketTimeoutException)\r\n5) bring the network back up\r\n6) tell it to read from the HTTP/2 server again (it'll be stuck w/ SocketTimeoutExceptions)\r\n7) if you create new http clients at this point, it'll work, but the dead http client will eventually come back in the pool and fail.\r\n\r\nokhttp client should attempt to reopen the HTTP/2 connection instead of being stuck in this state\r\n\r\nCode sample for Android (create a trivial view w/ a button and a textview):\r\n\r\n```\r\npublic class MainActivity extends AppCompatActivity {\r\n    OkHttpClient okhttpClient = new OkHttpClient();\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        Button loadButton = (Button) findViewById(R.id.loadButton);\r\n        TextView outputView = (TextView) findViewById(R.id.outputView);\r\n\r\n        loadButton.setOnClickListener(view -> Observable.fromCallable(() -> {\r\n                    Request request = new Request.Builder()\r\n                            .url(<INSERT URL TO YOUR HTTP/2 SERVER HERE>)\r\n                            .build();\r\n\r\n                    Response response = okhttpClient.newCall(request).execute();\r\n\r\n                    return response.body().string();\r\n                })\r\n                .subscribeOn(Schedulers.io())\r\n                .observeOn(AndroidSchedulers.mainThread())\r\n                .subscribe(outputView::setText, t -> outputView.setText(t.toString()))\r\n        );\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/329260810","html_url":"https://github.com/square/okhttp/issues/3146#issuecomment-329260810","issue_url":"https://api.github.com/repos/square/okhttp/issues/3146","id":329260810,"user":{"login":"natez0r","id":607283,"avatar_url":"https://avatars1.githubusercontent.com/u/607283?v=4","gravatar_id":"","url":"https://api.github.com/users/natez0r","html_url":"https://github.com/natez0r","followers_url":"https://api.github.com/users/natez0r/followers","following_url":"https://api.github.com/users/natez0r/following{/other_user}","gists_url":"https://api.github.com/users/natez0r/gists{/gist_id}","starred_url":"https://api.github.com/users/natez0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natez0r/subscriptions","organizations_url":"https://api.github.com/users/natez0r/orgs","repos_url":"https://api.github.com/users/natez0r/repos","events_url":"https://api.github.com/users/natez0r/events{/privacy}","received_events_url":"https://api.github.com/users/natez0r/received_events","type":"User","site_admin":false},"created_at":"2017-09-13T18:45:47Z","updated_at":"2017-09-13T18:45:47Z","author_association":"NONE","body":"any idea if/when this will be fixed? We're seeing the same issue."}}
{"actor":{"display_login":"natez0r"}}