Vikas Singh created KAFKA-10531:
-----------------------------------

             Summary: KafkaBasedLog can sleep for negative values
                 Key: KAFKA-10531
                 URL: https://issues.apache.org/jira/browse/KAFKA-10531
             Project: Kafka
          Issue Type: Bug
          Components: core
    Affects Versions: 2.6.0
            Reporter: Vikas Singh
             Fix For: 2.6.1


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

{{java.lang.IllegalArgumentException: timeout value is negative}}

 
{code:java}
        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));
        }
{code}

We need to check for negative value before sleeping.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to