[
https://issues.apache.org/jira/browse/BOOKKEEPER-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407662#comment-13407662
]
Uma Maheswara Rao G commented on BOOKKEEPER-327:
------------------------------------------------
Oops, I missed it. elapsed time passed with
long elapsedTime = System.currentTimeMillis() - startTime;
bkStats.getOpStats(BKStats.STATS_ADD).updateLatency(elapsedTime);
etc.
@Sijie, you mean you are proposing to check negative value while passing? shall
we keep the currentTimeMillis to nanoTime above?
or how about, checking for negative latency value, if it is negative value,
that is for sure system time change, we can warn saying "System time might have
changed, the calculated latency will not be correct/accurate one'.
then fall into the below category by setting latency to 0 ? But while
calculating averageLatency, it will mess up. It will produce almost wrong
values about avgLatency.
{code}
if (latency <= 100) { // less than 100ms
bucket = (int)(latency / 10);
}
{code}
> System.currentTimeMillis usage in BookKeeper
> --------------------------------------------
>
> Key: BOOKKEEPER-327
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-327
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Rakesh R
> Priority: Minor
> Attachments: BOOKKEEPER-327.patch
>
>
> The following exception occured in the bookie statistics logic due to the
> System time changes. In our bookie cluster its running a periodic syncup
> scripts just to unify the SystemTime in all the machines. This is causing the
> problem and resulting ArrayIndexOutOfBoundException.
> {code}
> Exception in thread "BookieJournal-3181"
> java.lang.ArrayIndexOutOfBoundsException: -423
> at org.apache.bookkeeper.proto.BKStats$OpStats.updateLatency(BKStats.java:126)
> at
> org.apache.bookkeeper.proto.BookieServer.writeComplete(BookieServer.java:655)
> at org.apache.bookkeeper.bookie.Journal.run(Journal.java:507)
> {code}
> This jira is raised to discuss whether to use ??System.nanoTime()?? instead
> of ??System.currentTimeMillis()??
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira