{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/108432437","pull_request_review_id":29461999,"id":108432437,"diff_hunk":"@@ -275,8 +275,10 @@ private void handleProduceResponse(ClientResponse response, Map<TopicPartition,\n                 for (Map.Entry<TopicPartition, ProduceResponse.PartitionResponse> entry : produceResponse.responses().entrySet()) {\n                     TopicPartition tp = entry.getKey();\n                     ProduceResponse.PartitionResponse partResp = entry.getValue();\n-                    ProducerBatch batch = batches.get(tp);\n-                    completeBatch(batch, partResp, correlationId, now);\n+                    if (tp != null && partResp != null) {\n+                        ProducerBatch batch = batches.get(tp);\n+                        completeBatch(batch, partResp, correlationId, now);\n+                    }","path":"clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java","position":9,"original_position":9,"commit_id":"4c063fda99096cc07deb2e1a424f17b7ed3aeee4","original_commit_id":"4c063fda99096cc07deb2e1a424f17b7ed3aeee4","user":{"login":"Aegeaner","id":1671185,"avatar_url":"https://avatars1.githubusercontent.com/u/1671185?v=3","gravatar_id":"","url":"https://api.github.com/users/Aegeaner","html_url":"https://github.com/Aegeaner","followers_url":"https://api.github.com/users/Aegeaner/followers","following_url":"https://api.github.com/users/Aegeaner/following{/other_user}","gists_url":"https://api.github.com/users/Aegeaner/gists{/gist_id}","starred_url":"https://api.github.com/users/Aegeaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aegeaner/subscriptions","organizations_url":"https://api.github.com/users/Aegeaner/orgs","repos_url":"https://api.github.com/users/Aegeaner/repos","events_url":"https://api.github.com/users/Aegeaner/events{/privacy}","received_events_url":"https://api.github.com/users/Aegeaner/received_events","type":"User","site_admin":false},"body":"According to KAFKA-4966, Producer may throw a NullPointerException under a network environment where packet loss and error packets exist.","created_at":"2017-03-28T14:13:27Z","updated_at":"2017-03-28T14:13:27Z","html_url":"https://github.com/apache/kafka/pull/2753#discussion_r108432437","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/2753","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/108432437"},"html":{"href":"https://github.com/apache/kafka/pull/2753#discussion_r108432437"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/2753"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/2753","id":112943261,"html_url":"https://github.com/apache/kafka/pull/2753","diff_url":"https://github.com/apache/kafka/pull/2753.diff","patch_url":"https://github.com/apache/kafka/pull/2753.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/2753","number":2753,"state":"open","locked":false,"title":"KAFKA-4966：Producer throw a NullPointerException under a network environment where packet loss and error packets exist.","user":{"login":"Aegeaner","id":1671185,"avatar_url":"https://avatars1.githubusercontent.com/u/1671185?v=3","gravatar_id":"","url":"https://api.github.com/users/Aegeaner","html_url":"https://github.com/Aegeaner","followers_url":"https://api.github.com/users/Aegeaner/followers","following_url":"https://api.github.com/users/Aegeaner/following{/other_user}","gists_url":"https://api.github.com/users/Aegeaner/gists{/gist_id}","starred_url":"https://api.github.com/users/Aegeaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aegeaner/subscriptions","organizations_url":"https://api.github.com/users/Aegeaner/orgs","repos_url":"https://api.github.com/users/Aegeaner/repos","events_url":"https://api.github.com/users/Aegeaner/events{/privacy}","received_events_url":"https://api.github.com/users/Aegeaner/received_events","type":"User","site_admin":false},"body":"fix KAFKA-4966 NPE in sender complete batch","created_at":"2017-03-28T11:03:39Z","updated_at":"2017-03-28T14:13:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c06be06ca9fc1315bdacc6055ec20c6434fa4bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/2753/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/2753/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/2753/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/4c063fda99096cc07deb2e1a424f17b7ed3aeee4","head":{"label":"Aegeaner:KAFKA-4966","ref":"KAFKA-4966","sha":"4c063fda99096cc07deb2e1a424f17b7ed3aeee4","user":{"login":"Aegeaner","id":1671185,"avatar_url":"https://avatars1.githubusercontent.com/u/1671185?v=3","gravatar_id":"","url":"https://api.github.com/users/Aegeaner","html_url":"https://github.com/Aegeaner","followers_url":"https://api.github.com/users/Aegeaner/followers","following_url":"https://api.github.com/users/Aegeaner/following{/other_user}","gists_url":"https://api.github.com/users/Aegeaner/gists{/gist_id}","starred_url":"https://api.github.com/users/Aegeaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aegeaner/subscriptions","organizations_url":"https://api.github.com/users/Aegeaner/orgs","repos_url":"https://api.github.com/users/Aegeaner/repos","events_url":"https://api.github.com/users/Aegeaner/events{/privacy}","received_events_url":"https://api.github.com/users/Aegeaner/received_events","type":"User","site_admin":false},"repo":{"id":76919690,"name":"kafka","full_name":"Aegeaner/kafka","owner":{"login":"Aegeaner","id":1671185,"avatar_url":"https://avatars1.githubusercontent.com/u/1671185?v=3","gravatar_id":"","url":"https://api.github.com/users/Aegeaner","html_url":"https://github.com/Aegeaner","followers_url":"https://api.github.com/users/Aegeaner/followers","following_url":"https://api.github.com/users/Aegeaner/following{/other_user}","gists_url":"https://api.github.com/users/Aegeaner/gists{/gist_id}","starred_url":"https://api.github.com/users/Aegeaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aegeaner/subscriptions","organizations_url":"https://api.github.com/users/Aegeaner/orgs","repos_url":"https://api.github.com/users/Aegeaner/repos","events_url":"https://api.github.com/users/Aegeaner/events{/privacy}","received_events_url":"https://api.github.com/users/Aegeaner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aegeaner/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/Aegeaner/kafka","forks_url":"https://api.github.com/repos/Aegeaner/kafka/forks","keys_url":"https://api.github.com/repos/Aegeaner/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aegeaner/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aegeaner/kafka/teams","hooks_url":"https://api.github.com/repos/Aegeaner/kafka/hooks","issue_events_url":"https://api.github.com/repos/Aegeaner/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/Aegeaner/kafka/events","assignees_url":"https://api.github.com/repos/Aegeaner/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/Aegeaner/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/Aegeaner/kafka/tags","blobs_url":"https://api.github.com/repos/Aegeaner/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aegeaner/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aegeaner/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aegeaner/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aegeaner/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/Aegeaner/kafka/languages","stargazers_url":"https://api.github.com/repos/Aegeaner/kafka/stargazers","contributors_url":"https://api.github.com/repos/Aegeaner/kafka/contributors","subscribers_url":"https://api.github.com/repos/Aegeaner/kafka/subscribers","subscription_url":"https://api.github.com/repos/Aegeaner/kafka/subscription","commits_url":"https://api.github.com/repos/Aegeaner/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aegeaner/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aegeaner/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aegeaner/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aegeaner/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/Aegeaner/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aegeaner/kafka/merges","archive_url":"https://api.github.com/repos/Aegeaner/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aegeaner/kafka/downloads","issues_url":"https://api.github.com/repos/Aegeaner/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/Aegeaner/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/Aegeaner/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/Aegeaner/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aegeaner/kafka/labels{/name}","releases_url":"https://api.github.com/repos/Aegeaner/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/Aegeaner/kafka/deployments","created_at":"2016-12-20T03:29:53Z","updated_at":"2016-12-20T03:30:00Z","pushed_at":"2017-03-28T11:01:43Z","git_url":"git://github.com/Aegeaner/kafka.git","ssh_url":"git@github.com:Aegeaner/kafka.git","clone_url":"https://github.com/Aegeaner/kafka.git","svn_url":"https://github.com/Aegeaner/kafka","homepage":null,"size":45008,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"f3f9a9eafb9aee9d87dd188521a4fd72466abfeb","user":{"login":"apache","id":47359,"avatar_url":"https://avatars3.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://avatars3.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":"2017-03-28T14:00:07Z","pushed_at":"2017-03-28T14:01:26Z","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":45289,"stargazers_count":4864,"watchers_count":4864,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3037,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":320,"forks":3037,"open_issues":320,"watchers":4864,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/2753"},"html":{"href":"https://github.com/apache/kafka/pull/2753"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/2753"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/2753/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/2753/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/2753/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/4c063fda99096cc07deb2e1a424f17b7ed3aeee4"}}}}
{"actor":{"display_login":"Aegeaner"}}