Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1863

Exception categories / hierarchy in clients

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.9.0.0
    • None
    • None

    Description

      In the new clients package we introduces a new set of exceptions, but its hierarchy is not very clear as of today:

      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
      

      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.

      Chris Riccomini may have some more feedbacks for this issue from Samza's usage experience. Jay Kreps

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            guozhang Guozhang Wang
            guozhang Guozhang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment