[ 
https://issues.apache.org/jira/browse/KAFKA-8862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921407#comment-16921407
 ] 

ASF GitHub Bot commented on KAFKA-8862:
---------------------------------------

tombentley commented on pull request #7283: KAFKA-8862: Use consistent 
exception messages for nonexistent partition
URL: https://github.com/apache/kafka/pull/7283
 
 
   Use the same exception message for timeout via 
`metadata.awaitUpdate(version, remainingWaitMs)` as for TimeoutException 
originating directly in `KafkaProducer.waitOnMetadata()`.
   
   The contribution is my original work and I license the work to the project 
under the project's open source license.
   
   cc/ @hachikuji 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Misleading exception message for non-existant partition
> -------------------------------------------------------
>
>                 Key: KAFKA-8862
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8862
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 2.3.0
>            Reporter: Tom Bentley
>            Assignee: Tom Bentley
>            Priority: Major
>
> https://issues.apache.org/jira/browse/KAFKA-6833 changed the logic of the 
> {{KafkaProducer.waitOnMetadata}} so that if a partition did not exist it 
> would wait for it to exist.
> It means that if called with an incorrect partition the method will 
> eventually throw a {{TimeoutException}}, which covers both topic and 
> partition non-existence cases.
> However, the exception message was not changed for the case where 
> {{metadata.awaitUpdate(version, remainingWaitMs)}} throws a 
> {{TimeoutException}}.
> This results in a confusing exception message. For example, if a producer 
> tries to send to a non-existent partition of an existing topic the message is 
> "Topic %s not present in metadata after %d ms.", when timeout via the other 
> code path would come with message
> "Partition %d of topic %s with partition count %d is not present in metadata 
> after %d ms."



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to