[
https://issues.apache.org/jira/browse/KAFKA-8862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthias J. Sax reassigned KAFKA-8862:
--------------------------------------
Assignee: Matthias J. Sax (was: Tom Bentley)
> 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: Matthias J. Sax
> Priority: Major
> Labels: patch-available
>
> 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.20.10#820010)