{"action":"closed","number":3903,"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/3903","id":38137564,"html_url":"https://github.com/netty/netty/pull/3903","diff_url":"https://github.com/netty/netty/pull/3903.diff","patch_url":"https://github.com/netty/netty/pull/3903.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/3903","number":3903,"state":"closed","locked":false,"title":"Add a fair-mode alternative of OrderedMemoryAwareThreadPoolExecutor.","user":{"login":"atellwu","id":2427749,"avatar_url":"https://avatars.githubusercontent.com/u/2427749?v=3","gravatar_id":"","url":"https://api.github.com/users/atellwu","html_url":"https://github.com/atellwu","followers_url":"https://api.github.com/users/atellwu/followers","following_url":"https://api.github.com/users/atellwu/following{/other_user}","gists_url":"https://api.github.com/users/atellwu/gists{/gist_id}","starred_url":"https://api.github.com/users/atellwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atellwu/subscriptions","organizations_url":"https://api.github.com/users/atellwu/orgs","repos_url":"https://api.github.com/users/atellwu/repos","events_url":"https://api.github.com/users/atellwu/events{/privacy}","received_events_url":"https://api.github.com/users/atellwu/received_events","type":"User","site_admin":false},"body":"This is a fair-mode alternative of OrderedMemoryAwareThreadPoolExecutor .\r\n \r\n \r\n### Motivation: \r\n1. Unfair of OrderedMemoryAwareThreadPoolExecutor\r\n The task executed in OrderedMemoryAwareThreadPoolExecutor is unfair in some situations.\r\n For example, let's say there is only one executor thread that handle the events from the two channels, and events are submitted in sequence: \r\n\r\n           Channel A (Event A1) , Channel B (Event B), Channel A (Event A2) , ... , Channel A (Event An)\r\n\r\n  Then the events maybe executed in this unfair order:\r\n\r\n          ----------------------------------------------------> Timeline ------------------------------------------------------>\r\n           Channel A (Event A1) , Channel A (Event A2) , ... , Channel A (Event An), Channel B (Event B)\r\n \r\n  As we see above, Channel B (Event B) maybe executed unfairly late.\r\n  Even more, if there are too much events come in Channel A, and one-by-one closely, then Channel B (Event B) would be waiting for a long while and become \"hungry\".\r\n \r\n \r\n### Modifications: \r\n1. Fair of FairOrderedMemoryAwareThreadPoolExecutor\r\n In the same case above ( one executor thread and two channels ) , this implement will guarantee execution order as:\r\n \r\n          ----------------------------------------------------> Timeline ------------------------------------------------------>\r\n           Channel A (Event A1) , Channel B (Event B), Channel A (Event A2) , ... , Channel A (Event An)\r\n \r\n \r\n*NOTE*: For convenience the case above use one single executor thread, but the fair mechanism is suitable for multiple executor threads situations.\r\n\r\n### result:\r\nThere is a fair-mode alternative of OrderedMemoryAwareThreadPoolExecutor and OrderedDownstreamThreadPoolExecutor now.\r\n","created_at":"2015-06-19T19:01:20Z","updated_at":"2015-06-30T11:35:44Z","closed_at":"2015-06-30T11:35:44Z","merged_at":null,"merge_commit_sha":"a1935f4b1e47007086227a66a77450050dce19a7","assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/121","html_url":"https://github.com/netty/netty/milestones/3.10.4.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/121/labels","id":1102420,"number":121,"title":"3.10.4.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":6,"state":"open","created_at":"2015-05-08T19:35:54Z","updated_at":"2015-06-30T11:35:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/netty/netty/pulls/3903/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/3903/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/3903/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/fc31117225cf40b6ea4ab1838661202b842e0ca1","head":{"label":"atellwu:3.10","ref":"3.10","sha":"fc31117225cf40b6ea4ab1838661202b842e0ca1","user":{"login":"atellwu","id":2427749,"avatar_url":"https://avatars.githubusercontent.com/u/2427749?v=3","gravatar_id":"","url":"https://api.github.com/users/atellwu","html_url":"https://github.com/atellwu","followers_url":"https://api.github.com/users/atellwu/followers","following_url":"https://api.github.com/users/atellwu/following{/other_user}","gists_url":"https://api.github.com/users/atellwu/gists{/gist_id}","starred_url":"https://api.github.com/users/atellwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atellwu/subscriptions","organizations_url":"https://api.github.com/users/atellwu/orgs","repos_url":"https://api.github.com/users/atellwu/repos","events_url":"https://api.github.com/users/atellwu/events{/privacy}","received_events_url":"https://api.github.com/users/atellwu/received_events","type":"User","site_admin":false},"repo":{"id":37725773,"name":"netty","full_name":"atellwu/netty","owner":{"login":"atellwu","id":2427749,"avatar_url":"https://avatars.githubusercontent.com/u/2427749?v=3","gravatar_id":"","url":"https://api.github.com/users/atellwu","html_url":"https://github.com/atellwu","followers_url":"https://api.github.com/users/atellwu/followers","following_url":"https://api.github.com/users/atellwu/following{/other_user}","gists_url":"https://api.github.com/users/atellwu/gists{/gist_id}","starred_url":"https://api.github.com/users/atellwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atellwu/subscriptions","organizations_url":"https://api.github.com/users/atellwu/orgs","repos_url":"https://api.github.com/users/atellwu/repos","events_url":"https://api.github.com/users/atellwu/events{/privacy}","received_events_url":"https://api.github.com/users/atellwu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atellwu/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/atellwu/netty","forks_url":"https://api.github.com/repos/atellwu/netty/forks","keys_url":"https://api.github.com/repos/atellwu/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atellwu/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atellwu/netty/teams","hooks_url":"https://api.github.com/repos/atellwu/netty/hooks","issue_events_url":"https://api.github.com/repos/atellwu/netty/issues/events{/number}","events_url":"https://api.github.com/repos/atellwu/netty/events","assignees_url":"https://api.github.com/repos/atellwu/netty/assignees{/user}","branches_url":"https://api.github.com/repos/atellwu/netty/branches{/branch}","tags_url":"https://api.github.com/repos/atellwu/netty/tags","blobs_url":"https://api.github.com/repos/atellwu/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atellwu/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atellwu/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/atellwu/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atellwu/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/atellwu/netty/languages","stargazers_url":"https://api.github.com/repos/atellwu/netty/stargazers","contributors_url":"https://api.github.com/repos/atellwu/netty/contributors","subscribers_url":"https://api.github.com/repos/atellwu/netty/subscribers","subscription_url":"https://api.github.com/repos/atellwu/netty/subscription","commits_url":"https://api.github.com/repos/atellwu/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/atellwu/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/atellwu/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/atellwu/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/atellwu/netty/contents/{+path}","compare_url":"https://api.github.com/repos/atellwu/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atellwu/netty/merges","archive_url":"https://api.github.com/repos/atellwu/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atellwu/netty/downloads","issues_url":"https://api.github.com/repos/atellwu/netty/issues{/number}","pulls_url":"https://api.github.com/repos/atellwu/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/atellwu/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/atellwu/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atellwu/netty/labels{/name}","releases_url":"https://api.github.com/repos/atellwu/netty/releases{/id}","created_at":"2015-06-19T14:18:57Z","updated_at":"2015-06-19T14:19:06Z","pushed_at":"2015-06-30T11:30:19Z","git_url":"git://github.com/atellwu/netty.git","ssh_url":"git@github.com:atellwu/netty.git","clone_url":"https://github.com/atellwu/netty.git","svn_url":"https://github.com/atellwu/netty","homepage":"http://netty.io/","size":43538,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"netty:3.10","ref":"3.10","sha":"3027a3145820a0d825681c4cc9385ae8848e88a9","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","created_at":"2010-11-09T09:22:21Z","updated_at":"2015-06-30T08:55:24Z","pushed_at":"2015-06-30T11:35:29Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":129191,"stargazers_count":4842,"watchers_count":4842,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2402,"mirror_url":null,"open_issues_count":287,"forks":2402,"open_issues":287,"watchers":4842,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/3903"},"html":{"href":"https://github.com/netty/netty/pull/3903"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/3903"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/3903/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/3903/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/3903/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/fc31117225cf40b6ea4ab1838661202b842e0ca1"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":17,"review_comments":15,"commits":1,"additions":540,"deletions":0,"changed_files":3}}