[
https://issues.apache.org/jira/browse/IGNITE-13015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17108348#comment-17108348
]
Ivan Daschinskiy commented on IGNITE-13015:
-------------------------------------------
Huge +1. {{System.currentTimeMillis()}} is backed by {{gettimeofday()}} and is
not monotonic. Instead, {{System.nanoTime()}}, that is backed by
{{clock_gettime(CLOCK_MONOTONIC,..)}} has monotonic guarantee with nanoseconds
precision. Moreover, both methods are not system calls in modern Linuxes thanks
to vDSO, so we can avoid context switches and don't worry about performance
drop. (see [here|http://man7.org/linux/man-pages/man7/vdso.7.html] for
details).
> Use nano time in node failure detection.
> ----------------------------------------
>
> Key: IGNITE-13015
> URL: https://issues.apache.org/jira/browse/IGNITE-13015
> Project: Ignite
> Issue Type: Improvement
> Reporter: Vladimir Steshin
> Assignee: Vladimir Steshin
> Priority: Minor
> Labels: iep-45
>
> Make sure in node failure detection not used:
> {code:java}
> System.currentTimeMillis()
> and
> IgniteUtils.currentTimeMillis()
> {code}
> Disadventages:
> 1) Current system time has no quarantine of strict forward movement.
> System time can be adjusted, synchronized by NTP as example. This can lead to
> incorrect and negative delays.
> 2) IgniteUtils.currentTimeMillis() is granulated by 10ms
--
This message was sent by Atlassian Jira
(v8.3.4#803005)