kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jun Rao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-3111) java.lang.ArithmeticException: / by zero in ConsumerPerformance
Date Sat, 16 Jan 2016 00:17:39 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15102761#comment-15102761
] 

Jun Rao commented on KAFKA-3111:
--------------------------------

Interesting, this article (http://voidexception.weebly.com/arithmeticexception---causes--fixes.html)
explains this. What's in the description happened in 0.8.2 where we define elapsedTime as
long. In this case, we hit ArithmeticException if elapsedTime is 0. In 0.9.0, we changed elapsedTime
to double. Then, if elapsedTime is 0, we get Infinity.

If there is no data between two iterations and elapsedTime is 0, we should report 0, instead
of Infinity. If there is data and elapsedTime is 0, we probably have no other choice but to
report Infinity.

> java.lang.ArithmeticException: / by zero in ConsumerPerformance
> ---------------------------------------------------------------
>
>                 Key: KAFKA-3111
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3111
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.9.0.0
>            Reporter: Jun Rao
>              Labels: newbie
>
> Saw the following error. If there are lots of unconsumed messages, between two iterations
of the consumption, the timestamp may not have changed.
> kafka-consumer-perf-test --zookeeper localhost:2181 --topic test --group test-group --threads
1 --show-detailed-stats --reporting-interval 5000
> 2016-01-13 09:12:43:905, 0, 1048576, 35.2856, 238.4186, 370000, 2500000.0000
> 2016-01-13 09:12:43:916, 0, 1048576, 35.7624, 47.6837, 375000, 500000.0000
> java.lang.ArithmeticException: / by zero
>         at kafka.tools.ConsumerPerformance$ConsumerPerfThread.printMessage(ConsumerPerformance.scala:189)
>         at kafka.tools.ConsumerPerformance$ConsumerPerfThread.run(ConsumerPerformance.scala:164)
> 2016-01-13 09:12:43:918, 0, 1048576, 36.2393, 0.7117, 380000, 7000.0000



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message