{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/47170300","id":47170300,"diff_hunk":"@@ -25,14 +25,12 @@ import org.junit.Assert._\n import org.junit.{After, Before, Test}\n \n class ProducerBounceTest extends KafkaServerTestHarness {\n-  private val producerBufferSize = 30000\n-  private val serverMessageMaxBytes =  producerBufferSize/2\n+  private val producerBufferSize = 1024L * 1024L\n \n   val numServers = 2\n \n   val overridingProps = new Properties()\n   overridingProps.put(KafkaConfig.AutoCreateTopicsEnableProp, false.toString)\n-  overridingProps.put(KafkaConfig.MessageMaxBytesProp, serverMessageMaxBytes.toString)","path":"core/src/test/scala/integration/kafka/api/ProducerBounceTest.scala","position":12,"original_position":12,"commit_id":"cd5e6f4700a4387f9383b84aca0ee9c4639b1033","original_commit_id":"cd5e6f4700a4387f9383b84aca0ee9c4639b1033","user":{"login":"guozhangwang","id":10729597,"avatar_url":"https://avatars.githubusercontent.com/u/10729597?v=3","gravatar_id":"","url":"https://api.github.com/users/guozhangwang","html_url":"https://github.com/guozhangwang","followers_url":"https://api.github.com/users/guozhangwang/followers","following_url":"https://api.github.com/users/guozhangwang/following{/other_user}","gists_url":"https://api.github.com/users/guozhangwang/gists{/gist_id}","starred_url":"https://api.github.com/users/guozhangwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guozhangwang/subscriptions","organizations_url":"https://api.github.com/users/guozhangwang/orgs","repos_url":"https://api.github.com/users/guozhangwang/repos","events_url":"https://api.github.com/users/guozhangwang/events{/privacy}","received_events_url":"https://api.github.com/users/guozhangwang/received_events","type":"User","site_admin":false},"body":"Why do you need to remove this config?","created_at":"2015-12-09T23:39:00Z","updated_at":"2015-12-09T23:39:00Z","html_url":"https://github.com/apache/kafka/pull/648#discussion_r47170300","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/648","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/47170300"},"html":{"href":"https://github.com/apache/kafka/pull/648#discussion_r47170300"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/648"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/648","id":53122268,"html_url":"https://github.com/apache/kafka/pull/648","diff_url":"https://github.com/apache/kafka/pull/648.diff","patch_url":"https://github.com/apache/kafka/pull/648.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/648","number":648,"state":"open","locked":false,"title":"KAFKA-2837: fix transient failure of kafka.api.ProducerBounceTest > testBrokerFailure","user":{"login":"ZoneMayor","id":4058918,"avatar_url":"https://avatars.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoneMayor","html_url":"https://github.com/ZoneMayor","followers_url":"https://api.github.com/users/ZoneMayor/followers","following_url":"https://api.github.com/users/ZoneMayor/following{/other_user}","gists_url":"https://api.github.com/users/ZoneMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoneMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoneMayor/subscriptions","organizations_url":"https://api.github.com/users/ZoneMayor/orgs","repos_url":"https://api.github.com/users/ZoneMayor/repos","events_url":"https://api.github.com/users/ZoneMayor/events{/privacy}","received_events_url":"https://api.github.com/users/ZoneMayor/received_events","type":"User","site_admin":false},"body":"I can reproduced this transient failure, it seldom happen;\r\ncode is like below:\r\n // rolling bounce brokers\r\n    for (i <- 0 until numServers) {\r\n      for (server <- servers) {\r\n        server.shutdown()\r\n        server.awaitShutdown()\r\n        server.startup()\r\n        Thread.sleep(2000)\r\n      }\r\n\r\n      // Make sure the producer do not see any exception\r\n      // in returned metadata due to broker failures\r\n      assertTrue(scheduler.failed == false)\r\n\r\n      // Make sure the leader still exists after bouncing brokers\r\n      (0 until numPartitions).foreach(partition => TestUtils.waitUntilLeaderIsElectedOrChanged(zkUtils, topic1, partition))\r\nBrokers keep rolling restart, and producer keep sending messages;\r\nIn every loop, it will wait for election of partition leader;\r\nBut if the election is slow, more messages will be buffered in RecordAccumulator's BufferPool;\r\nThe limit for buffer is set to be 30000;\r\nTimeoutException(\"Failed to allocate memory within the configured max blocking time\") will show up when out of memory;\r\nSince for every restart of the broker, it will sleep for 2000 ms,  so this transient failure seldom happen;\r\nBut if I reduce the sleeping period, the bigger chance failure happens; \r\nfor example if the broker with role of controller suffered a restart, it will take time to select controller first, then select leader, which will lead to more messges blocked in KafkaProducer:RecordAccumulator:BufferPool;\r\nIn this fix, I just enlarge the producer's buffer size to be 1MB;\r\n@guozhangwang , Could you give some comments?","created_at":"2015-12-09T14:04:05Z","updated_at":"2015-12-09T23:39:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fdf99ee134dd857bd625682909c043d12f986d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/648/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/648/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/648/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/cd5e6f4700a4387f9383b84aca0ee9c4639b1033","head":{"label":"ZoneMayor:trunk-KAFKA-2837","ref":"trunk-KAFKA-2837","sha":"cd5e6f4700a4387f9383b84aca0ee9c4639b1033","user":{"login":"ZoneMayor","id":4058918,"avatar_url":"https://avatars.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoneMayor","html_url":"https://github.com/ZoneMayor","followers_url":"https://api.github.com/users/ZoneMayor/followers","following_url":"https://api.github.com/users/ZoneMayor/following{/other_user}","gists_url":"https://api.github.com/users/ZoneMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoneMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoneMayor/subscriptions","organizations_url":"https://api.github.com/users/ZoneMayor/orgs","repos_url":"https://api.github.com/users/ZoneMayor/repos","events_url":"https://api.github.com/users/ZoneMayor/events{/privacy}","received_events_url":"https://api.github.com/users/ZoneMayor/received_events","type":"User","site_admin":false},"repo":{"id":46220223,"name":"kafka","full_name":"ZoneMayor/kafka","owner":{"login":"ZoneMayor","id":4058918,"avatar_url":"https://avatars.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoneMayor","html_url":"https://github.com/ZoneMayor","followers_url":"https://api.github.com/users/ZoneMayor/followers","following_url":"https://api.github.com/users/ZoneMayor/following{/other_user}","gists_url":"https://api.github.com/users/ZoneMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoneMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoneMayor/subscriptions","organizations_url":"https://api.github.com/users/ZoneMayor/orgs","repos_url":"https://api.github.com/users/ZoneMayor/repos","events_url":"https://api.github.com/users/ZoneMayor/events{/privacy}","received_events_url":"https://api.github.com/users/ZoneMayor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZoneMayor/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/ZoneMayor/kafka","forks_url":"https://api.github.com/repos/ZoneMayor/kafka/forks","keys_url":"https://api.github.com/repos/ZoneMayor/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZoneMayor/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZoneMayor/kafka/teams","hooks_url":"https://api.github.com/repos/ZoneMayor/kafka/hooks","issue_events_url":"https://api.github.com/repos/ZoneMayor/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/ZoneMayor/kafka/events","assignees_url":"https://api.github.com/repos/ZoneMayor/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/ZoneMayor/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/ZoneMayor/kafka/tags","blobs_url":"https://api.github.com/repos/ZoneMayor/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZoneMayor/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZoneMayor/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZoneMayor/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZoneMayor/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/ZoneMayor/kafka/languages","stargazers_url":"https://api.github.com/repos/ZoneMayor/kafka/stargazers","contributors_url":"https://api.github.com/repos/ZoneMayor/kafka/contributors","subscribers_url":"https://api.github.com/repos/ZoneMayor/kafka/subscribers","subscription_url":"https://api.github.com/repos/ZoneMayor/kafka/subscription","commits_url":"https://api.github.com/repos/ZoneMayor/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZoneMayor/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZoneMayor/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZoneMayor/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZoneMayor/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/ZoneMayor/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZoneMayor/kafka/merges","archive_url":"https://api.github.com/repos/ZoneMayor/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZoneMayor/kafka/downloads","issues_url":"https://api.github.com/repos/ZoneMayor/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/ZoneMayor/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/ZoneMayor/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/ZoneMayor/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZoneMayor/kafka/labels{/name}","releases_url":"https://api.github.com/repos/ZoneMayor/kafka/releases{/id}","created_at":"2015-11-15T14:12:50Z","updated_at":"2015-11-15T14:12:55Z","pushed_at":"2015-12-09T13:49:26Z","git_url":"git://github.com/ZoneMayor/kafka.git","ssh_url":"git@github.com:ZoneMayor/kafka.git","clone_url":"https://github.com/ZoneMayor/kafka.git","svn_url":"https://github.com/ZoneMayor/kafka","homepage":null,"size":26023,"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":"991aad23baa2f55d405d374b0a01785acdc63974","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}","created_at":"2011-08-15T18:06:16Z","updated_at":"2015-12-09T21:05:37Z","pushed_at":"2015-12-09T23:16:31Z","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":32341,"stargazers_count":2329,"watchers_count":2329,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1378,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":119,"forks":1378,"open_issues":119,"watchers":2329,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/648"},"html":{"href":"https://github.com/apache/kafka/pull/648"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/648"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/648/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/648/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/648/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/cd5e6f4700a4387f9383b84aca0ee9c4639b1033"}}}}