{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/211427676","pull_request_review_id":147846591,"id":211427676,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTQyNzY3Ng==","diff_hunk":"@@ -273,6 +273,10 @@ private boolean isMuted(TopicPartition tp, long now) {\n         return result;\n     }\n \n+    public void resetNextBatchExpiryTime() {\n+        nextBatchExpiryTimeMs = Long.MAX_VALUE;","path":"clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java","position":5,"original_position":5,"commit_id":"1f8d86dcdda9ab6ebc55d8c59c2c248da5ad9ac8","original_commit_id":"1f8d86dcdda9ab6ebc55d8c59c2c248da5ad9ac8","user":{"login":"mjsax","id":8959638,"node_id":"MDQ6VXNlcjg5NTk2Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/8959638?v=4","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"body":"@rodesai @guozhangwang For my own education: why do we reset to MAX_VALUE?","created_at":"2018-08-20T22:30:26Z","updated_at":"2018-08-20T22:30:26Z","html_url":"https://github.com/apache/kafka/pull/5531#discussion_r211427676","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/5531","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/211427676"},"html":{"href":"https://github.com/apache/kafka/pull/5531#discussion_r211427676"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/5531"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/5531","id":209337133,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzM3MTMz","html_url":"https://github.com/apache/kafka/pull/5531","diff_url":"https://github.com/apache/kafka/pull/5531.diff","patch_url":"https://github.com/apache/kafka/pull/5531.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/5531","number":5531,"state":"closed","locked":false,"title":"KAFKA-7311: Reset next batch expiry time on each poll loop","user":{"login":"rodesai","id":2610028,"node_id":"MDQ6VXNlcjI2MTAwMjg=","avatar_url":"https://avatars0.githubusercontent.com/u/2610028?v=4","gravatar_id":"","url":"https://api.github.com/users/rodesai","html_url":"https://github.com/rodesai","followers_url":"https://api.github.com/users/rodesai/followers","following_url":"https://api.github.com/users/rodesai/following{/other_user}","gists_url":"https://api.github.com/users/rodesai/gists{/gist_id}","starred_url":"https://api.github.com/users/rodesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodesai/subscriptions","organizations_url":"https://api.github.com/users/rodesai/orgs","repos_url":"https://api.github.com/users/rodesai/repos","events_url":"https://api.github.com/users/rodesai/events{/privacy}","received_events_url":"https://api.github.com/users/rodesai/received_events","type":"User","site_admin":false},"body":"Sender/RecordAccumulator never resets the next batch expiry time. Its always computed as the min of the current value and the expiry time for all batches being processed. This means that its always set to the expiry time of the first batch, and once that time has passed Sender starts spinning on epoll with a timeout of 0, which consumes a lot of CPU. This patch updates Sender to reset the next batch expiry time on each poll loop so that a new value reflecting the expiry time for the current set of batches is computed.\r\n\r\ncc @guozhangwang @hachikuji @ijuma \r\nHope you folks are the right people to review.\r\n\r\n\r\n### Committer Checklist (excluded from commit message)\r\n- [ ] Verify design and implementation \r\n- [ ] Verify test coverage and CI build status\r\n- [ ] Verify documentation (including upgrade notes)\r\n","created_at":"2018-08-19T00:56:18Z","updated_at":"2018-08-20T22:30:26Z","closed_at":"2018-08-20T19:41:21Z","merged_at":"2018-08-20T19:41:21Z","merge_commit_sha":"ea4078e72a737268cc45776a10d8c3a566be9b4a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/5531/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/5531/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/5531/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/1f8d86dcdda9ab6ebc55d8c59c2c248da5ad9ac8","head":{"label":"rodesai:KAFKA_7311","ref":"KAFKA_7311","sha":"1f8d86dcdda9ab6ebc55d8c59c2c248da5ad9ac8","user":{"login":"rodesai","id":2610028,"node_id":"MDQ6VXNlcjI2MTAwMjg=","avatar_url":"https://avatars0.githubusercontent.com/u/2610028?v=4","gravatar_id":"","url":"https://api.github.com/users/rodesai","html_url":"https://github.com/rodesai","followers_url":"https://api.github.com/users/rodesai/followers","following_url":"https://api.github.com/users/rodesai/following{/other_user}","gists_url":"https://api.github.com/users/rodesai/gists{/gist_id}","starred_url":"https://api.github.com/users/rodesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodesai/subscriptions","organizations_url":"https://api.github.com/users/rodesai/orgs","repos_url":"https://api.github.com/users/rodesai/repos","events_url":"https://api.github.com/users/rodesai/events{/privacy}","received_events_url":"https://api.github.com/users/rodesai/received_events","type":"User","site_admin":false},"repo":{"id":114796522,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ3OTY1MjI=","name":"kafka","full_name":"rodesai/kafka","owner":{"login":"rodesai","id":2610028,"node_id":"MDQ6VXNlcjI2MTAwMjg=","avatar_url":"https://avatars0.githubusercontent.com/u/2610028?v=4","gravatar_id":"","url":"https://api.github.com/users/rodesai","html_url":"https://github.com/rodesai","followers_url":"https://api.github.com/users/rodesai/followers","following_url":"https://api.github.com/users/rodesai/following{/other_user}","gists_url":"https://api.github.com/users/rodesai/gists{/gist_id}","starred_url":"https://api.github.com/users/rodesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodesai/subscriptions","organizations_url":"https://api.github.com/users/rodesai/orgs","repos_url":"https://api.github.com/users/rodesai/repos","events_url":"https://api.github.com/users/rodesai/events{/privacy}","received_events_url":"https://api.github.com/users/rodesai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rodesai/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/rodesai/kafka","forks_url":"https://api.github.com/repos/rodesai/kafka/forks","keys_url":"https://api.github.com/repos/rodesai/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rodesai/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rodesai/kafka/teams","hooks_url":"https://api.github.com/repos/rodesai/kafka/hooks","issue_events_url":"https://api.github.com/repos/rodesai/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/rodesai/kafka/events","assignees_url":"https://api.github.com/repos/rodesai/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/rodesai/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/rodesai/kafka/tags","blobs_url":"https://api.github.com/repos/rodesai/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rodesai/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rodesai/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/rodesai/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rodesai/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/rodesai/kafka/languages","stargazers_url":"https://api.github.com/repos/rodesai/kafka/stargazers","contributors_url":"https://api.github.com/repos/rodesai/kafka/contributors","subscribers_url":"https://api.github.com/repos/rodesai/kafka/subscribers","subscription_url":"https://api.github.com/repos/rodesai/kafka/subscription","commits_url":"https://api.github.com/repos/rodesai/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/rodesai/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/rodesai/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/rodesai/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/rodesai/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/rodesai/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rodesai/kafka/merges","archive_url":"https://api.github.com/repos/rodesai/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rodesai/kafka/downloads","issues_url":"https://api.github.com/repos/rodesai/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/rodesai/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/rodesai/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/rodesai/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rodesai/kafka/labels{/name}","releases_url":"https://api.github.com/repos/rodesai/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/rodesai/kafka/deployments","created_at":"2017-12-19T18:08:34Z","updated_at":"2018-08-19T00:54:51Z","pushed_at":"2018-08-19T00:54:39Z","git_url":"git://github.com/rodesai/kafka.git","ssh_url":"git@github.com:rodesai/kafka.git","clone_url":"https://github.com/rodesai/kafka.git","svn_url":"https://github.com/rodesai/kafka","homepage":null,"size":70540,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"b282b2ab1073a04d33009865b4e9c600899bc2a0","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"node_id":"MDEwOlJlcG9zaXRvcnkyMjExMjQz","name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2018-08-20T20:29:21Z","pushed_at":"2018-08-20T22:30:22Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":72062,"stargazers_count":9347,"watchers_count":9347,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5319,"mirror_url":null,"archived":false,"open_issues_count":491,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5319,"open_issues":491,"watchers":9347,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/5531"},"html":{"href":"https://github.com/apache/kafka/pull/5531"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/5531"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/5531/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/5531/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/5531/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/1f8d86dcdda9ab6ebc55d8c59c2c248da5ad9ac8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mjsax"}}