[jboss-jira] [JBoss JIRA] (JGRP-1637) Counters overflow

Bela Ban (JIRA) jira-events at lists.jboss.org
Mon Jul 1 08:07:21 EDT 2013


    [ https://issues.jboss.org/browse/JGRP-1637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786471#comment-12786471 ] 

Bela Ban commented on JGRP-1637:
--------------------------------

Another example prone to overflow are counters of the number of bytes sent/received. Investigate use of BigInteger / BigLong (?)
                
> Counters overflow
> -----------------
>
>                 Key: JGRP-1637
>                 URL: https://issues.jboss.org/browse/JGRP-1637
>             Project: JGroups
>          Issue Type: Task
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.4
>
>
> We have some counters which might see a lot of increments. Investigate which counters are affected (and how) by a potential wraparound, e.g. longs wrap around at 2^63 and go negative.
> For example, storing delivery times in nanoseconds and totalling that number could end up with an overflow as e.g. 2ms = 2000000ns, for 1 million msgs/sec would overflow in roughly 7 weeks ! That's the reason org.jgroups.util.Average was created: instead of totalling delivery time and the number of deliveries to compute avg delivery time, we only maintain a fixed array of delivery times, and its elements are randomly overwritten with new values, so we only keep the (more or less) most recent N values to compute the average.
> Using a long for a message sequence number should not be an issue: even if we send 1 million messages / sec, we could send for roughly 290'000 years !

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list