[
https://issues.apache.org/jira/browse/CASSANDRA-5584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mikhail Mazursky updated CASSANDRA-5584:
----------------------------------------
Attachment: trunk-5584.txt
> Incorrect use of System.nanoTime()
> ----------------------------------
>
> Key: CASSANDRA-5584
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5584
> Project: Cassandra
> Issue Type: Bug
> Reporter: Mikhail Mazursky
> Priority: Trivial
> Attachments: trunk-5584.txt
>
>
> From System.nanoTime() JavaDoc:
> {noformat}
> For example, to measure how long some code takes to execute:
> long startTime = System.nanoTime();
> // ... the code being measured ...
> long estimatedTime = System.nanoTime() - startTime;
> To compare two nanoTime values
> long t0 = System.nanoTime();
> ...
> long t1 = System.nanoTime();
> one should use t1 - t0 < 0, not t1 < t0, because of the possibility of
> numerical overflow.
> {noformat}
> I found one place with such incorrect use that can result in overflow and in
> incorrect timeout handling. See attached patch.
--
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