Bela Ban created JGRP-1637:
------------------------------
Summary: 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