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

Tsz-wo Sze edited comment on HDDS-12459 at 3/5/25 10:56 PM:
------------------------------------------------------------

{quote}some Intel cpu versions had different clocks per core; ...
{quote}
[[email protected]], thanks for the infos! JVM/JDK should deal with this kind 
of low level details while System.nanoTime() should work in such case as 
specified in the 
[javadoc|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#nanoTime()].
{quote}... This method can only be used to measure elapsed time and is not 
related to any other notion of system or wall-clock time. ...
{quote}


was (Author: szetszwo):
bq. some Intel cpu versions had different clocks per core; ...

[[email protected]], thanks for the infos!  JVM should deal with this kind of 
low level details while System.nanoTime() should work in such case as specified 
in the 
[javadoc|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#nanoTime()].

bq. ... This method can only be used to measure elapsed time and is not related 
to any other notion of system or wall-clock time.  ...

> System clock should not be used for measuring time duration
> -----------------------------------------------------------
>
>                 Key: HDDS-12459
>                 URL: https://issues.apache.org/jira/browse/HDDS-12459
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Tsz-wo Sze
>            Assignee: Chia-Chuan Yu
>            Priority: Major
>
> java.time.Clock (system(ZoneId) / systemDefaultZone() / systemUTC()) uses 
> System.currentTimeMillis().  As described in HADOOP-15901, this could result 
> in undesired results when system clock's time changes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to