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

Avoid long or infinite blocking in the consumer

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: consumer
    • Labels:
      None

      Description

      The new consumer has a lot of loops that look something like

        while(!isThingComplete())
          client.poll();
      

      This occurs both in KafkaConsumer but also in NetworkClient.completeAll. These retry loops are actually mostly the behavior we want but there are several cases where they may cause problems:

      • In the case of a hard failure we may hang for a long time or indefinitely before realizing the connection is lost.
      • In the case where the cluster is malfunctioning or down we may retry forever.

      It would probably be better to give a timeout to these. The proposed approach would be to add something like retry.time.ms=60000 and only continue retrying for that period of time.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hachikuji Jason Gustafson
                Reporter:
                jkreps Jay Kreps
              • Votes:
                22 Vote for this issue
                Watchers:
                42 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: