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

New consumer offsetsForTimes timeout exception has wrong message

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

Details

    Description

      If a call to consumer.offsetsForTimes times out, the new AsyncKafkaConsumer will throw a org.apache.kafka.common.errors.TimeoutException as expected, but with the following as message: "java.util.concurrent.TimeoutException".

      We should provide a clearer message, and I would even say we keep the same message that the LegacyConsumer shows in this case, ex: "Failed to get offsets by times in 60000ms".

      To fix this we should consider catching the timeout exception in the consumer when offsetsForTimes result times out (here), and propagate it with the message specific to offsetsForTimes.

      Same situation exists for beginningOffsets and endOffsets. All 3 funcs show the same timeout message in the LegacyConsumer (defined here), but do not have a clear message in the Async, so we should fix them all 3.

      With the fix, we should write tests for each func, like the ones defined for the Legacy Consumer (here). Note that we would need different tests, added to AsyncKafkaConsumerTest, given that the AsyncKafkaConsumer issues a FindCoordinator request in this case (on manager poll), but the LegacyKafkaConsumer does not, so it does not account for that when matching requests/responses in the current tests.

      Attachments

        Activity

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

          People

            lianetm Lianet Magrans
            lianetm Lianet Magrans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment