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
- links to