{"action":"created","comment":{"url":"https://api.github.com/repos/h2o/h2o/pulls/comments/83312529","pull_request_review_id":4165528,"id":83312529,"diff_hunk":"@@ -614,6 +618,14 @@ static int handle_priority_frame(h2o_http2_conn_t *conn, h2o_http2_frame_t *fram\n         if (h2o_http2_scheduler_get_weight(&stream->_refs.scheduler) != 257)\n             set_priority(conn, stream, &payload, 1);\n     } else {\n+        /* Ignore PRIORITY frames for closed streams */\n+        if (frame->stream_id & 1) {","path":"lib/http2/connection.c","position":16,"original_position":16,"commit_id":"5078835a9f8389ef159811a9c1a52a5f489a2188","original_commit_id":"5078835a9f8389ef159811a9c1a52a5f489a2188","user":{"login":"kazuho","id":41567,"avatar_url":"https://avatars.githubusercontent.com/u/41567?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuho","html_url":"https://github.com/kazuho","followers_url":"https://api.github.com/users/kazuho/followers","following_url":"https://api.github.com/users/kazuho/following{/other_user}","gists_url":"https://api.github.com/users/kazuho/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuho/subscriptions","organizations_url":"https://api.github.com/users/kazuho/orgs","repos_url":"https://api.github.com/users/kazuho/repos","events_url":"https://api.github.com/users/kazuho/events{/privacy}","received_events_url":"https://api.github.com/users/kazuho/received_events","type":"User","site_admin":false},"body":"Could you please change the check to `if (h2o_http2_stream_is_push(frame->stream_id))`? That is the wrapper function we have.","created_at":"2016-10-13T21:07:58Z","updated_at":"2016-10-13T21:07:58Z","html_url":"https://github.com/h2o/h2o/pull/1105#discussion_r83312529","pull_request_url":"https://api.github.com/repos/h2o/h2o/pulls/1105","_links":{"self":{"href":"https://api.github.com/repos/h2o/h2o/pulls/comments/83312529"},"html":{"href":"https://github.com/h2o/h2o/pull/1105#discussion_r83312529"},"pull_request":{"href":"https://api.github.com/repos/h2o/h2o/pulls/1105"}}},"pull_request":{"url":"https://api.github.com/repos/h2o/h2o/pulls/1105","id":88938370,"html_url":"https://github.com/h2o/h2o/pull/1105","diff_url":"https://github.com/h2o/h2o/pull/1105.diff","patch_url":"https://github.com/h2o/h2o/pull/1105.patch","issue_url":"https://api.github.com/repos/h2o/h2o/issues/1105","number":1105,"state":"open","locked":false,"title":"Ignore PRIORITY frames that reference closed pushed streams","user":{"login":"deweerdt","id":5094,"avatar_url":"https://avatars.githubusercontent.com/u/5094?v=3","gravatar_id":"","url":"https://api.github.com/users/deweerdt","html_url":"https://github.com/deweerdt","followers_url":"https://api.github.com/users/deweerdt/followers","following_url":"https://api.github.com/users/deweerdt/following{/other_user}","gists_url":"https://api.github.com/users/deweerdt/gists{/gist_id}","starred_url":"https://api.github.com/users/deweerdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deweerdt/subscriptions","organizations_url":"https://api.github.com/users/deweerdt/orgs","repos_url":"https://api.github.com/users/deweerdt/repos","events_url":"https://api.github.com/users/deweerdt/events{/privacy}","received_events_url":"https://api.github.com/users/deweerdt/received_events","type":"User","site_admin":false},"body":"Firefox sends a PRIORITY frame when receiving a PUSH_PROMISE frame.\r\nBecause of the racy nature of the protocol, it's very possible that the\r\nPRIORITY frame is received once the stream is closed on H2O side.\r\n\r\nThis results in us opening a new stream that will be used to account\r\nagainst `globalconf->http2.max_streams_for_priority`. Eventually, this\r\ncan lead to sending a GOAWAY frame with 'ENHANCE_YOUR_CALM'.\r\n\r\nI believe it's safe to ignore PRIORITY frames that reference pushed\r\nstreams that are closed, since no current browser appears to use those\r\nto reference them later.\r\n\r\nI've tested the fix by using the following handler (and a dummy js file)\r\nand verified that we hit the GOAWAY path without the fix, and not anymore\r\nwith the fix:\r\n\r\n```\r\n        mruby.handler: |\r\n          Proc.new do |env|\r\n            case env[\"PATH_INFO\"]\r\n            when \"/\"\r\n              push_paths = []\r\n              (1..100).each { |i| push_paths << \"/index.js?#{i}\" }\r\n              [399, push_paths.empty? ? {} : {\"link\" =>\r\nush_paths.map{|p| \"<#{p}>; rel=preload\"}.join(\",\")}, []]\r\n            else\r\n              [399, {}, []]\r\n            end\r\n          end\r\n```","created_at":"2016-10-12T01:19:04Z","updated_at":"2016-10-13T21:13:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c0a871f3dd9fc842e8871463d9e780c9da2276d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/h2o/h2o/pulls/1105/commits","review_comments_url":"https://api.github.com/repos/h2o/h2o/pulls/1105/comments","review_comment_url":"https://api.github.com/repos/h2o/h2o/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2o/h2o/issues/1105/comments","statuses_url":"https://api.github.com/repos/h2o/h2o/statuses/5078835a9f8389ef159811a9c1a52a5f489a2188","head":{"label":"deweerdt:ignore-priority-frames-on-closed-pushed-streams","ref":"ignore-priority-frames-on-closed-pushed-streams","sha":"5078835a9f8389ef159811a9c1a52a5f489a2188","user":{"login":"deweerdt","id":5094,"avatar_url":"https://avatars.githubusercontent.com/u/5094?v=3","gravatar_id":"","url":"https://api.github.com/users/deweerdt","html_url":"https://github.com/deweerdt","followers_url":"https://api.github.com/users/deweerdt/followers","following_url":"https://api.github.com/users/deweerdt/following{/other_user}","gists_url":"https://api.github.com/users/deweerdt/gists{/gist_id}","starred_url":"https://api.github.com/users/deweerdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deweerdt/subscriptions","organizations_url":"https://api.github.com/users/deweerdt/orgs","repos_url":"https://api.github.com/users/deweerdt/repos","events_url":"https://api.github.com/users/deweerdt/events{/privacy}","received_events_url":"https://api.github.com/users/deweerdt/received_events","type":"User","site_admin":false},"repo":{"id":55793737,"name":"h2o","full_name":"deweerdt/h2o","owner":{"login":"deweerdt","id":5094,"avatar_url":"https://avatars.githubusercontent.com/u/5094?v=3","gravatar_id":"","url":"https://api.github.com/users/deweerdt","html_url":"https://github.com/deweerdt","followers_url":"https://api.github.com/users/deweerdt/followers","following_url":"https://api.github.com/users/deweerdt/following{/other_user}","gists_url":"https://api.github.com/users/deweerdt/gists{/gist_id}","starred_url":"https://api.github.com/users/deweerdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deweerdt/subscriptions","organizations_url":"https://api.github.com/users/deweerdt/orgs","repos_url":"https://api.github.com/users/deweerdt/repos","events_url":"https://api.github.com/users/deweerdt/events{/privacy}","received_events_url":"https://api.github.com/users/deweerdt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deweerdt/h2o","description":"H2O - the optimized HTTP/1, HTTP/2 server","fork":true,"url":"https://api.github.com/repos/deweerdt/h2o","forks_url":"https://api.github.com/repos/deweerdt/h2o/forks","keys_url":"https://api.github.com/repos/deweerdt/h2o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deweerdt/h2o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deweerdt/h2o/teams","hooks_url":"https://api.github.com/repos/deweerdt/h2o/hooks","issue_events_url":"https://api.github.com/repos/deweerdt/h2o/issues/events{/number}","events_url":"https://api.github.com/repos/deweerdt/h2o/events","assignees_url":"https://api.github.com/repos/deweerdt/h2o/assignees{/user}","branches_url":"https://api.github.com/repos/deweerdt/h2o/branches{/branch}","tags_url":"https://api.github.com/repos/deweerdt/h2o/tags","blobs_url":"https://api.github.com/repos/deweerdt/h2o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deweerdt/h2o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deweerdt/h2o/git/refs{/sha}","trees_url":"https://api.github.com/repos/deweerdt/h2o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deweerdt/h2o/statuses/{sha}","languages_url":"https://api.github.com/repos/deweerdt/h2o/languages","stargazers_url":"https://api.github.com/repos/deweerdt/h2o/stargazers","contributors_url":"https://api.github.com/repos/deweerdt/h2o/contributors","subscribers_url":"https://api.github.com/repos/deweerdt/h2o/subscribers","subscription_url":"https://api.github.com/repos/deweerdt/h2o/subscription","commits_url":"https://api.github.com/repos/deweerdt/h2o/commits{/sha}","git_commits_url":"https://api.github.com/repos/deweerdt/h2o/git/commits{/sha}","comments_url":"https://api.github.com/repos/deweerdt/h2o/comments{/number}","issue_comment_url":"https://api.github.com/repos/deweerdt/h2o/issues/comments{/number}","contents_url":"https://api.github.com/repos/deweerdt/h2o/contents/{+path}","compare_url":"https://api.github.com/repos/deweerdt/h2o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deweerdt/h2o/merges","archive_url":"https://api.github.com/repos/deweerdt/h2o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deweerdt/h2o/downloads","issues_url":"https://api.github.com/repos/deweerdt/h2o/issues{/number}","pulls_url":"https://api.github.com/repos/deweerdt/h2o/pulls{/number}","milestones_url":"https://api.github.com/repos/deweerdt/h2o/milestones{/number}","notifications_url":"https://api.github.com/repos/deweerdt/h2o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deweerdt/h2o/labels{/name}","releases_url":"https://api.github.com/repos/deweerdt/h2o/releases{/id}","deployments_url":"https://api.github.com/repos/deweerdt/h2o/deployments","created_at":"2016-04-08T16:30:51Z","updated_at":"2016-04-08T16:30:55Z","pushed_at":"2016-10-13T04:06:53Z","git_url":"git://github.com/deweerdt/h2o.git","ssh_url":"git@github.com:deweerdt/h2o.git","clone_url":"https://github.com/deweerdt/h2o.git","svn_url":"https://github.com/deweerdt/h2o","homepage":"https://h2o.examp1e.net","size":50704,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"h2o:master","ref":"master","sha":"a04cdc13a5aa1575238e2554db116b516a1d9852","user":{"login":"h2o","id":9275116,"avatar_url":"https://avatars.githubusercontent.com/u/9275116?v=3","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"repo":{"id":23029617,"name":"h2o","full_name":"h2o/h2o","owner":{"login":"h2o","id":9275116,"avatar_url":"https://avatars.githubusercontent.com/u/9275116?v=3","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2o/h2o","description":"H2O - the optimized HTTP/1, HTTP/2 server","fork":false,"url":"https://api.github.com/repos/h2o/h2o","forks_url":"https://api.github.com/repos/h2o/h2o/forks","keys_url":"https://api.github.com/repos/h2o/h2o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2o/h2o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2o/h2o/teams","hooks_url":"https://api.github.com/repos/h2o/h2o/hooks","issue_events_url":"https://api.github.com/repos/h2o/h2o/issues/events{/number}","events_url":"https://api.github.com/repos/h2o/h2o/events","assignees_url":"https://api.github.com/repos/h2o/h2o/assignees{/user}","branches_url":"https://api.github.com/repos/h2o/h2o/branches{/branch}","tags_url":"https://api.github.com/repos/h2o/h2o/tags","blobs_url":"https://api.github.com/repos/h2o/h2o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2o/h2o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2o/h2o/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2o/h2o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2o/h2o/statuses/{sha}","languages_url":"https://api.github.com/repos/h2o/h2o/languages","stargazers_url":"https://api.github.com/repos/h2o/h2o/stargazers","contributors_url":"https://api.github.com/repos/h2o/h2o/contributors","subscribers_url":"https://api.github.com/repos/h2o/h2o/subscribers","subscription_url":"https://api.github.com/repos/h2o/h2o/subscription","commits_url":"https://api.github.com/repos/h2o/h2o/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2o/h2o/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2o/h2o/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2o/h2o/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2o/h2o/contents/{+path}","compare_url":"https://api.github.com/repos/h2o/h2o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2o/h2o/merges","archive_url":"https://api.github.com/repos/h2o/h2o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2o/h2o/downloads","issues_url":"https://api.github.com/repos/h2o/h2o/issues{/number}","pulls_url":"https://api.github.com/repos/h2o/h2o/pulls{/number}","milestones_url":"https://api.github.com/repos/h2o/h2o/milestones{/number}","notifications_url":"https://api.github.com/repos/h2o/h2o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2o/h2o/labels{/name}","releases_url":"https://api.github.com/repos/h2o/h2o/releases{/id}","deployments_url":"https://api.github.com/repos/h2o/h2o/deployments","created_at":"2014-08-16T23:59:03Z","updated_at":"2016-10-13T21:00:00Z","pushed_at":"2016-10-13T04:06:54Z","git_url":"git://github.com/h2o/h2o.git","ssh_url":"git@github.com:h2o/h2o.git","clone_url":"https://github.com/h2o/h2o.git","svn_url":"https://github.com/h2o/h2o","homepage":"https://h2o.examp1e.net","size":58260,"stargazers_count":5984,"watchers_count":5984,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":462,"mirror_url":null,"open_issues_count":260,"forks":462,"open_issues":260,"watchers":5984,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2o/h2o/pulls/1105"},"html":{"href":"https://github.com/h2o/h2o/pull/1105"},"issue":{"href":"https://api.github.com/repos/h2o/h2o/issues/1105"},"comments":{"href":"https://api.github.com/repos/h2o/h2o/issues/1105/comments"},"review_comments":{"href":"https://api.github.com/repos/h2o/h2o/pulls/1105/comments"},"review_comment":{"href":"https://api.github.com/repos/h2o/h2o/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2o/h2o/pulls/1105/commits"},"statuses":{"href":"https://api.github.com/repos/h2o/h2o/statuses/5078835a9f8389ef159811a9c1a52a5f489a2188"}}}}
{"actor":{"display_login":"kazuho"}}