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

KafkaBasedLog can sleep for negative values

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.7.0, 2.5.2, 2.6.1
    • Component/s: core
    • Labels:
      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

          Activity

            People

            • Assignee:
              vikasconfluent Vikas Singh
              Reporter:
              vikasconfluent Vikas Singh
              Reviewer:
              Randall Hauch

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment