{"action":"created","comment":{"url":"https://api.github.com/repos/square/okhttp/pulls/comments/133949679","pull_request_review_id":57190233,"id":133949679,"diff_hunk":"@@ -257,6 +257,29 @@ private RealConnection findConnection(int connectTimeout, int readTimeout, int w\n     return result;\n   }\n \n+  /**\n+   * Returns the previous allocated connection or null if there is no previous allocated connection.\n+   * We will have a previous allocated connection in the case of follow-up requests. With HTTP/2\n+   * multiple requests share the same connection so it's possible that our connection is flagged to\n+   * disallow new streams during a follow-up request.\n+   */\n+  private RealConnection previousAllocatedConnection() {\n+    assert (Thread.holdsLock(connectionPool));\n+\n+    RealConnection allocatedConnection = this.connection;\n+    if (allocatedConnection == null) return null;\n+\n+    if (allocatedConnection.noNewStreams) {\n+      // Our connection was flagged to disallow new streams. This could happen in HTTP/2 when\n+      // multiple requests use the same connection. Discard it.\n+      deallocate(false, false, true);","path":"okhttp/src/main/java/okhttp3/internal/connection/StreamAllocation.java","position":30,"original_position":30,"commit_id":"cfbe4eb742e859d56bdba577a58b45cb17a70590","original_commit_id":"cfbe4eb742e859d56bdba577a58b45cb17a70590","user":{"login":"dave-r12","id":1520761,"avatar_url":"https://avatars2.githubusercontent.com/u/1520761?v=4","gravatar_id":"","url":"https://api.github.com/users/dave-r12","html_url":"https://github.com/dave-r12","followers_url":"https://api.github.com/users/dave-r12/followers","following_url":"https://api.github.com/users/dave-r12/following{/other_user}","gists_url":"https://api.github.com/users/dave-r12/gists{/gist_id}","starred_url":"https://api.github.com/users/dave-r12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dave-r12/subscriptions","organizations_url":"https://api.github.com/users/dave-r12/orgs","repos_url":"https://api.github.com/users/dave-r12/repos","events_url":"https://api.github.com/users/dave-r12/events{/privacy}","received_events_url":"https://api.github.com/users/dave-r12/received_events","type":"User","site_admin":false},"body":"Ahh right, missed that. 👍  to `releaseIfNoNewStreams()`. I'll fix that.","created_at":"2017-08-18T12:45:10Z","updated_at":"2017-08-18T12:45:10Z","html_url":"https://github.com/square/okhttp/pull/3525#discussion_r133949679","pull_request_url":"https://api.github.com/repos/square/okhttp/pulls/3525","_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments/133949679"},"html":{"href":"https://github.com/square/okhttp/pull/3525#discussion_r133949679"},"pull_request":{"href":"https://api.github.com/repos/square/okhttp/pulls/3525"}}},"pull_request":{"url":"https://api.github.com/repos/square/okhttp/pulls/3525","id":135797229,"html_url":"https://github.com/square/okhttp/pull/3525","diff_url":"https://github.com/square/okhttp/pull/3525.diff","patch_url":"https://github.com/square/okhttp/pull/3525.patch","issue_url":"https://api.github.com/repos/square/okhttp/issues/3525","number":3525,"state":"open","locked":false,"title":"Recover from a previous allocated connection with noNewStreams.","user":{"login":"dave-r12","id":1520761,"avatar_url":"https://avatars2.githubusercontent.com/u/1520761?v=4","gravatar_id":"","url":"https://api.github.com/users/dave-r12","html_url":"https://github.com/dave-r12","followers_url":"https://api.github.com/users/dave-r12/followers","following_url":"https://api.github.com/users/dave-r12/following{/other_user}","gists_url":"https://api.github.com/users/dave-r12/gists{/gist_id}","starred_url":"https://api.github.com/users/dave-r12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dave-r12/subscriptions","organizations_url":"https://api.github.com/users/dave-r12/orgs","repos_url":"https://api.github.com/users/dave-r12/repos","events_url":"https://api.github.com/users/dave-r12/events{/privacy}","received_events_url":"https://api.github.com/users/dave-r12/received_events","type":"User","site_admin":false},"body":"This is an edge case that can occur with HTTP/2. Since multiple requests\r\nuse the same connection, it's possible for one request to flag the\r\nconnection as bad during a follow-up request.\r\n\r\nhttps://github.com/square/okhttp/issues/3521","created_at":"2017-08-15T13:10:01Z","updated_at":"2017-08-18T12:45:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82c8b8cf3a1f395b346912c1348bb072fcea4d6a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/square/okhttp/pulls/3525/commits","review_comments_url":"https://api.github.com/repos/square/okhttp/pulls/3525/comments","review_comment_url":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/okhttp/issues/3525/comments","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/cfbe4eb742e859d56bdba577a58b45cb17a70590","head":{"label":"square:dr.0815.discard-connection-nonewstreams","ref":"dr.0815.discard-connection-nonewstreams","sha":"cfbe4eb742e859d56bdba577a58b45cb17a70590","user":{"login":"square","id":82592,"avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+HTTP/2 client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","deployments_url":"https://api.github.com/repos/square/okhttp/deployments","created_at":"2012-07-23T13:42:55Z","updated_at":"2017-08-18T09:57:29Z","pushed_at":"2017-08-17T20:59:52Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":15999,"stargazers_count":21837,"watchers_count":21837,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5294,"mirror_url":null,"open_issues_count":119,"forks":5294,"open_issues":119,"watchers":21837,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"2e934cff3fd3fabd1a21af714c575ce4dac8809f","user":{"login":"square","id":82592,"avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+HTTP/2 client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","deployments_url":"https://api.github.com/repos/square/okhttp/deployments","created_at":"2012-07-23T13:42:55Z","updated_at":"2017-08-18T09:57:29Z","pushed_at":"2017-08-17T20:59:52Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":15999,"stargazers_count":21837,"watchers_count":21837,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5294,"mirror_url":null,"open_issues_count":119,"forks":5294,"open_issues":119,"watchers":21837,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/3525"},"html":{"href":"https://github.com/square/okhttp/pull/3525"},"issue":{"href":"https://api.github.com/repos/square/okhttp/issues/3525"},"comments":{"href":"https://api.github.com/repos/square/okhttp/issues/3525/comments"},"review_comments":{"href":"https://api.github.com/repos/square/okhttp/pulls/3525/comments"},"review_comment":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/okhttp/pulls/3525/commits"},"statuses":{"href":"https://api.github.com/repos/square/okhttp/statuses/cfbe4eb742e859d56bdba577a58b45cb17a70590"}}}}
{"actor":{"display_login":"dave-r12"}}