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

Guozhang Wang commented on KAFKA-1863:
--------------------------------------

My original motivation of this ticket is to make it more clear to the users 
about "when" does "which" exception can possibly be thrown, and upon catching 
them "what" could be done. With that in mind I was thinking the following 
things can be done here:

1) rename OffsetMetadataTooLarge to OffsetMetadataTooLargeException.
2) document for each exception thrown from producer.send, are they retriable or 
fatal (today only BufferExhausted are retriable).
3) document for each exception thrown in future, user can tell what to do based 
on the exception type (extended from RetriableException or not).

For concrete use cases like Chris/Navina's, we can also document about the 
semantics of the thrown exceptions such as 1) did the exception cause the whole 
batch to fail, 2) does it possibly cause out-of-order and how it is related to 
pipelining scheme / in-flight requests, 3) etc...

> Exception categories / hierarchy in clients
> -------------------------------------------
>
>                 Key: KAFKA-1863
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1863
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Guozhang Wang
>            Assignee: Guozhang Wang
>             Fix For: 0.9.0
>
>
> In the new clients package we introduces a new set of exceptions, but its 
> hierarchy is not very clear as of today:
> {code}
> RuntimeException -> KafkaException -> BufferExhastedException
>                                                            -> ConfigException
>                                                            -> 
> SerializationException
>                                                            -> 
> QuotaViolationException
>                                                            -> SchemaException
>                                                            -> ApiException
> ApiException -> InvalidTopicException
>                      -> OffsetMetadataTooLarge (probabaly need to be renamed)
>                      -> RecordBatchTooLargeException
>                      -> RecordTooLargeException
>                      -> UnknownServerException
>                      -> RetriableException
> RetriableException -> CorruptRecordException
>                                -> InvalidMetadataException
>                                -> NotEnoughtReplicasAfterAppendException
>                                -> NotEnoughReplicasException
>                                -> OffsetOutOfRangeException
>                                -> TimeoutException
>                                -> UnknownTopicOrPartitionException
> {code}
> KafkaProducer.send() may throw KafkaExceptions that are not ApiExceptions; 
> other exceptions will be set in the returned future metadata.
> We need better to
> 1. Re-examine the hierarchy. For example, for producers only exceptions that 
> are thrown directly from the caller thread before it is appended to the batch 
> buffer should be ApiExceptions; some exceptions could be renamed / merged.
> 2. Clearly document the exception category / hierarchy as part of the release.
> [~criccomini] may have some more feedbacks for this issue from Samza's usage 
> experience. [~jkreps]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to