hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15901) IPC Client and Server should use Time.monotonicNow() for elapsed times.
Date Mon, 05 Nov 2018 13:21:01 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-15901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16675133#comment-16675133

Steve Loughran commented on HADOOP-15901:


I used to think MonotonicNow was good, but now I don't. 

h3. Monotonic now is not guaranteed to be consistent across cores in a single socket, absolutely
not consistent across sockets

It is only safe to use in certain situations
* you are doing micro benchmarks where you can take averages of many runs discard outliers
* you want a very low cost time value for diagnostics and testing & can cope with inconsistency,
and you are confident the probability of a thread being suspended and rescheduled is 0
* you are running code where you have used CPU affinity calls to bind a thread to a specific
core, and you are confident that you are not running in a VM, where the host OS can remap
virtual to physical cores as it chooses.

Given IPC blocks for network requests, I'm not sure it matches any of these.

Further reading: 

> IPC Client and Server should use Time.monotonicNow() for elapsed times.
> -----------------------------------------------------------------------
>                 Key: HADOOP-15901
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15901
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, metrics
>            Reporter: Vinayakumar B
>            Assignee: Vinayakumar B
>            Priority: Major
>         Attachments: HADOOP-15901-01.patch
> Client.java and Server.java  uses {{Time.now()}} to calculate the elapsed times/timeouts.
This could result in undesired results when system clock's time changes.
> {{Time.monotonicNow()}} should be used for elapsed time calculations within same JVM.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message