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

Exceptions from RequestFuture lack parts of the stack trace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • clients
    • None

    Description

      When an exception occurs within a task that reports its result using a RequestFuture, that exception is stored in a field on the RequestFuture using the raise method. In many places in the code where such futures are completed, that exception is then thrown directly using throw future.exception(); (see e.g. Fetcher.getTopicMetadata).
      This means that the exception that ends up in client code only has stack traces related to the original exception, but nothing leading up to the completion of the future. The client therefore gets no indication of what was going on in the client code - only that it somehow ended up in the Kafka libraries, and that a task failed at some point.
      One solution to this is to use the exceptions from the future as causes for chained exceptions, so that the client gets a stack trace that shows what the client was doing, in addition to getting the stack traces for the exception in the task.

      Attachments

        Issue Links

          Activity

            People

              vahid Vahid Hashemian
              magnus.reftel Magnus Reftel
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: