You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Randall Hauch (Jira)" <ji...@apache.org> on 2020/10/05 19:28:00 UTC

[jira] [Updated] (KAFKA-10531) KafkaBasedLog can sleep for negative values

     [ https://issues.apache.org/jira/browse/KAFKA-10531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Randall Hauch updated KAFKA-10531:
----------------------------------
    Fix Version/s: 2.5.2
                   2.7.0

> 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
>            Assignee: Vikas Singh
>            Priority: Major
>             Fix For: 2.7.0, 2.5.2, 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)