{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/56350137","id":56350137,"diff_hunk":"@@ -76,7 +78,8 @@ public ProducerInterceptors(List<ProducerInterceptor<K, V>> interceptors) {\n      *\n      * This method does not throw exceptions. Exceptions thrown by any of interceptor methods are caught and ignored.\n      *\n-     * @param metadata The metadata for the record that was sent (i.e. the partition and offset). Null if an error occurred.\n+     * @param metadata The metadata for the record that was sent (i.e. the partition and offset).\n+     *                 If an error occurred, metadata will only contain valid topic and maybe partition.","path":"clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerInterceptors.java","position":15,"original_position":15,"commit_id":"c29b395f2fb8f34c749fcf66a637b7cf3bb5c1b4","original_commit_id":"c29b395f2fb8f34c749fcf66a637b7cf3bb5c1b4","user":{"login":"junrao","id":132330,"avatar_url":"https://avatars.githubusercontent.com/u/132330?v=3","gravatar_id":"","url":"https://api.github.com/users/junrao","html_url":"https://github.com/junrao","followers_url":"https://api.github.com/users/junrao/followers","following_url":"https://api.github.com/users/junrao/following{/other_user}","gists_url":"https://api.github.com/users/junrao/gists{/gist_id}","starred_url":"https://api.github.com/users/junrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junrao/subscriptions","organizations_url":"https://api.github.com/users/junrao/orgs","repos_url":"https://api.github.com/users/junrao/repos","events_url":"https://api.github.com/users/junrao/events{/privacy}","received_events_url":"https://api.github.com/users/junrao/received_events","type":"User","site_admin":false},"body":"Got it. However, we probably want to make the api in interceptor consistent with producer Callback. Similar things can happen in the producer callback where we don't have the full metadata, but just the topic/partition. Currently, we just pass a null RecordMetadata. It may be useful to preserve the available metadata there. It's just that changing the exception type in Callback is an incompatible api change.","created_at":"2016-03-16T15:06:15Z","updated_at":"2016-03-16T15:06:15Z","html_url":"https://github.com/apache/kafka/pull/1015#discussion_r56350137","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1015","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/56350137"},"html":{"href":"https://github.com/apache/kafka/pull/1015#discussion_r56350137"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1015"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1015","id":61794233,"html_url":"https://github.com/apache/kafka/pull/1015","diff_url":"https://github.com/apache/kafka/pull/1015.diff","patch_url":"https://github.com/apache/kafka/pull/1015.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1015","number":1015,"state":"open","locked":false,"title":"KAFKA-3303: Pass partial record metadata to ProducerInterceptor.onAcknowledgement on error","user":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"body":"This is a KIP-42 followup. \r\n\r\nCurrently, If sending the record fails before it gets to the server, ProducerInterceptor.onAcknowledgement() is called with metadata == null, and non-null exception. However, it is useful to pass topic and partition, if known, to ProducerInterceptor.onAcknowledgement() as well. This patch ensures that  ProducerInterceptor.onAcknowledgement()  gets record metadata with topic and maybe partition. If partition is not set in 'record' and KafkaProducer.send() fails before partition gets assigned, then ProducerInterceptor.onAcknowledgement() gets RecordMetadata with partition == -1. Only time when  ProducerInterceptor.onAcknowledgement() gets null record metadata is when the client passes null record to KafkaProducer.send().","created_at":"2016-03-05T01:11:19Z","updated_at":"2016-03-16T15:06:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"306c5237176f0df20891b8a4d13ff0fbf6098331","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1015/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1015/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1015/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/c29b395f2fb8f34c749fcf66a637b7cf3bb5c1b4","head":{"label":"apovzner:kip42-3","ref":"kip42-3","sha":"c29b395f2fb8f34c749fcf66a637b7cf3bb5c1b4","user":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"repo":{"id":44782457,"name":"kafka","full_name":"apovzner/kafka","owner":{"login":"apovzner","id":5383840,"avatar_url":"https://avatars.githubusercontent.com/u/5383840?v=3","gravatar_id":"","url":"https://api.github.com/users/apovzner","html_url":"https://github.com/apovzner","followers_url":"https://api.github.com/users/apovzner/followers","following_url":"https://api.github.com/users/apovzner/following{/other_user}","gists_url":"https://api.github.com/users/apovzner/gists{/gist_id}","starred_url":"https://api.github.com/users/apovzner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apovzner/subscriptions","organizations_url":"https://api.github.com/users/apovzner/orgs","repos_url":"https://api.github.com/users/apovzner/repos","events_url":"https://api.github.com/users/apovzner/events{/privacy}","received_events_url":"https://api.github.com/users/apovzner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apovzner/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/apovzner/kafka","forks_url":"https://api.github.com/repos/apovzner/kafka/forks","keys_url":"https://api.github.com/repos/apovzner/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apovzner/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apovzner/kafka/teams","hooks_url":"https://api.github.com/repos/apovzner/kafka/hooks","issue_events_url":"https://api.github.com/repos/apovzner/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apovzner/kafka/events","assignees_url":"https://api.github.com/repos/apovzner/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apovzner/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apovzner/kafka/tags","blobs_url":"https://api.github.com/repos/apovzner/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apovzner/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apovzner/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apovzner/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apovzner/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apovzner/kafka/languages","stargazers_url":"https://api.github.com/repos/apovzner/kafka/stargazers","contributors_url":"https://api.github.com/repos/apovzner/kafka/contributors","subscribers_url":"https://api.github.com/repos/apovzner/kafka/subscribers","subscription_url":"https://api.github.com/repos/apovzner/kafka/subscription","commits_url":"https://api.github.com/repos/apovzner/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apovzner/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apovzner/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apovzner/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apovzner/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apovzner/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apovzner/kafka/merges","archive_url":"https://api.github.com/repos/apovzner/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apovzner/kafka/downloads","issues_url":"https://api.github.com/repos/apovzner/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apovzner/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apovzner/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apovzner/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apovzner/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apovzner/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apovzner/kafka/deployments","created_at":"2015-10-23T01:03:29Z","updated_at":"2015-10-23T01:03:34Z","pushed_at":"2016-03-11T18:38:47Z","git_url":"git://github.com/apovzner/kafka.git","ssh_url":"git@github.com:apovzner/kafka.git","clone_url":"https://github.com/apovzner/kafka.git","svn_url":"https://github.com/apovzner/kafka","homepage":null,"size":27481,"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":"04ef9c35479f5cf92df3b74a7379ce77dc809243","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-03-16T15:00:24Z","pushed_at":"2016-03-16T15:03:35Z","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":36534,"stargazers_count":2781,"watchers_count":2781,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1682,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":161,"forks":1682,"open_issues":161,"watchers":2781,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1015"},"html":{"href":"https://github.com/apache/kafka/pull/1015"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1015"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1015/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1015/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1015/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/c29b395f2fb8f34c749fcf66a637b7cf3bb5c1b4"}}}}