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

KafkaBasedLog can sleep for negative values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.7.0, 2.5.2, 2.6.1
    • core
    • None

    Description

      time.milliseconds is not monotonic, so this code can throw :

      java.lang.IllegalArgumentException: timeout value is negative

       

              long started = time.milliseconds();
              while (partitionInfos == null && time.milliseconds() - started < CREATE_TOPIC_TIMEOUT_MS) {
                  partitionInfos = consumer.partitionsFor(topic);
                  Utils.sleep(Math.min(time.milliseconds() - started, 1000));
              }
      

      We need to check for negative value before sleeping.

      Attachments

        Issue Links

          Activity

            People

              vikasconfluent Vikas Singh
              vikasconfluent Vikas Singh
              Randall Hauch Randall Hauch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: