You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Vikas Singh (Jira)" <ji...@apache.org> on 2020/09/28 20:07:00 UTC
[jira] [Assigned] (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 ]
Vikas Singh reassigned KAFKA-10531:
-----------------------------------
Assignee: Vikas Singh
> 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.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)