{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/51818787","id":51818787,"diff_hunk":"@@ -527,12 +527,14 @@ object MirrorMaker extends Logging with KafkaMetricsGroup {\n       }\n     }\n \n-    // New consumer always hasNext\n     override def hasData = true\n \n     override def receive() : BaseConsumerRecord = {\n-      while (recordIter == null || !recordIter.hasNext)\n+      if (recordIter == null || !recordIter.hasNext) {\n         recordIter = consumer.poll(1000).iterator\n+        if (!recordIter.hasNext)\n+          throw new ConsumerTimeoutException","path":"core/src/main/scala/kafka/tools/MirrorMaker.scala","position":12,"original_position":12,"commit_id":"3f193b04ab9fa6f2abaf80b07c259cbf8fb5dba2","original_commit_id":"3f193b04ab9fa6f2abaf80b07c259cbf8fb5dba2","user":{"login":"xiaotao183","id":706267,"avatar_url":"https://avatars.githubusercontent.com/u/706267?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotao183","html_url":"https://github.com/xiaotao183","followers_url":"https://api.github.com/users/xiaotao183/followers","following_url":"https://api.github.com/users/xiaotao183/following{/other_user}","gists_url":"https://api.github.com/users/xiaotao183/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotao183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotao183/subscriptions","organizations_url":"https://api.github.com/users/xiaotao183/orgs","repos_url":"https://api.github.com/users/xiaotao183/repos","events_url":"https://api.github.com/users/xiaotao183/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotao183/received_events","type":"User","site_admin":false},"body":"I agreed with @ijuma. Probably it doesn't make too much difference considering the fact that it is not thrown that much. And it is better to keep it the same the way old consumer works.","created_at":"2016-02-04T01:43:55Z","updated_at":"2016-02-04T01:43:55Z","html_url":"https://github.com/apache/kafka/pull/821#discussion_r51818787","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/821","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/51818787"},"html":{"href":"https://github.com/apache/kafka/pull/821#discussion_r51818787"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/821"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/821","id":57466582,"html_url":"https://github.com/apache/kafka/pull/821","diff_url":"https://github.com/apache/kafka/pull/821.diff","patch_url":"https://github.com/apache/kafka/pull/821.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/821","number":821,"state":"open","locked":false,"title":"KAFKA-3157 - Mirror maker doesn't commit offset","user":{"login":"xiaotao183","id":706267,"avatar_url":"https://avatars.githubusercontent.com/u/706267?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotao183","html_url":"https://github.com/xiaotao183","followers_url":"https://api.github.com/users/xiaotao183/followers","following_url":"https://api.github.com/users/xiaotao183/following{/other_user}","gists_url":"https://api.github.com/users/xiaotao183/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotao183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotao183/subscriptions","organizations_url":"https://api.github.com/users/xiaotao183/orgs","repos_url":"https://api.github.com/users/xiaotao183/repos","events_url":"https://api.github.com/users/xiaotao183/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotao183/received_events","type":"User","site_admin":false},"body":"Mirror maker doesn't commit offset with new consumer enabled when data volume is low. This is caused by infinite loop in ```receive()``` which would never jump out of loop if no data coming","created_at":"2016-01-28T07:44:42Z","updated_at":"2016-02-04T01:43:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad44fb33442a1519d826ece92eef1effb0624963","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/821/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/821/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/821/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/3f193b04ab9fa6f2abaf80b07c259cbf8fb5dba2","head":{"label":"xiaotao183:KAFKA-3157","ref":"KAFKA-3157","sha":"3f193b04ab9fa6f2abaf80b07c259cbf8fb5dba2","user":{"login":"xiaotao183","id":706267,"avatar_url":"https://avatars.githubusercontent.com/u/706267?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotao183","html_url":"https://github.com/xiaotao183","followers_url":"https://api.github.com/users/xiaotao183/followers","following_url":"https://api.github.com/users/xiaotao183/following{/other_user}","gists_url":"https://api.github.com/users/xiaotao183/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotao183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotao183/subscriptions","organizations_url":"https://api.github.com/users/xiaotao183/orgs","repos_url":"https://api.github.com/users/xiaotao183/repos","events_url":"https://api.github.com/users/xiaotao183/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotao183/received_events","type":"User","site_admin":false},"repo":{"id":49813957,"name":"kafka","full_name":"xiaotao183/kafka","owner":{"login":"xiaotao183","id":706267,"avatar_url":"https://avatars.githubusercontent.com/u/706267?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotao183","html_url":"https://github.com/xiaotao183","followers_url":"https://api.github.com/users/xiaotao183/followers","following_url":"https://api.github.com/users/xiaotao183/following{/other_user}","gists_url":"https://api.github.com/users/xiaotao183/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotao183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotao183/subscriptions","organizations_url":"https://api.github.com/users/xiaotao183/orgs","repos_url":"https://api.github.com/users/xiaotao183/repos","events_url":"https://api.github.com/users/xiaotao183/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotao183/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xiaotao183/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/xiaotao183/kafka","forks_url":"https://api.github.com/repos/xiaotao183/kafka/forks","keys_url":"https://api.github.com/repos/xiaotao183/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiaotao183/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiaotao183/kafka/teams","hooks_url":"https://api.github.com/repos/xiaotao183/kafka/hooks","issue_events_url":"https://api.github.com/repos/xiaotao183/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/xiaotao183/kafka/events","assignees_url":"https://api.github.com/repos/xiaotao183/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/xiaotao183/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/xiaotao183/kafka/tags","blobs_url":"https://api.github.com/repos/xiaotao183/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiaotao183/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiaotao183/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiaotao183/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiaotao183/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/xiaotao183/kafka/languages","stargazers_url":"https://api.github.com/repos/xiaotao183/kafka/stargazers","contributors_url":"https://api.github.com/repos/xiaotao183/kafka/contributors","subscribers_url":"https://api.github.com/repos/xiaotao183/kafka/subscribers","subscription_url":"https://api.github.com/repos/xiaotao183/kafka/subscription","commits_url":"https://api.github.com/repos/xiaotao183/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiaotao183/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiaotao183/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiaotao183/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiaotao183/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/xiaotao183/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiaotao183/kafka/merges","archive_url":"https://api.github.com/repos/xiaotao183/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiaotao183/kafka/downloads","issues_url":"https://api.github.com/repos/xiaotao183/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/xiaotao183/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/xiaotao183/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/xiaotao183/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiaotao183/kafka/labels{/name}","releases_url":"https://api.github.com/repos/xiaotao183/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/xiaotao183/kafka/deployments","created_at":"2016-01-17T11:09:19Z","updated_at":"2016-01-17T11:09:23Z","pushed_at":"2016-02-02T11:14:45Z","git_url":"git://github.com/xiaotao183/kafka.git","ssh_url":"git@github.com:xiaotao183/kafka.git","clone_url":"https://github.com/xiaotao183/kafka.git","svn_url":"https://github.com/xiaotao183/kafka","homepage":null,"size":27032,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"a40a2a260a8ddde8651dd8278bf70da7c67b2c1d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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":"2016-02-04T01:11:13Z","pushed_at":"2016-02-04T01:15:00Z","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":34688,"stargazers_count":2597,"watchers_count":2597,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1546,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":121,"forks":1546,"open_issues":121,"watchers":2597,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/821"},"html":{"href":"https://github.com/apache/kafka/pull/821"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/821"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/821/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/821/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/821/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/3f193b04ab9fa6f2abaf80b07c259cbf8fb5dba2"}}}}