[jira] [Commented] (YARN-4177) yarn.util.Clock should not be used to time a duration or time interval

2015-09-21 Thread Xianyin Xin (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-4177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14900450#comment-14900450
 ] 

Xianyin Xin commented on YARN-4177:
---

Hi [~ste...@apache.org], thanks for your comment. I've read your post and did 
some investgations on this.
{quote}
1.Inconsistent across cores, hence non-monotonic on reads, especially reads 
likely to trigger thread suspend/resume (anything with sleep(), wait(), IO, 
accessing synchronized data under load).
{quote}
This was once a bug on some old OSs, but it seems not a problem on Linux newer 
than 2.6 or windows newer than XP SP2, if i understand your comment correctly. 
See 
http://stackoverflow.com/questions/510462/is-system-nanotime-completely-useless,
 and the refered 
https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_vm_clocks.
{quote}
2.Not actually monotonic.
{quote}
Can you explain in detail? As a reference, there're some discussion on 
clock_gettime which nanoTime depends in 
http://stackoverflow.com/questions/4943733/is-clock-monotonic-process-or-thread-specific?rq=1,
 especially in the second post that has 4 supports.
{quote}
3.Achieving a consistency by querying heavyweight counters with possible longer 
function execution time and lower granularity than the wall clock.
That is: modern NUMA, multi-socket servers are essentially multiple computers 
wired together, and we have a term for that: distributed system
{quote}
You mean achieving a consistent time across nodes in a cluster? I think the 
monotonic time we plan to offer should be limited to node-local. It's hard to 
make it cluster wide. 
{quote}
I've known for a long time that CPU frequency could change its rate
{quote}
I remembered Linux higher than 2.6.18 takes some measures to overcome this 
problem. 
http://stackoverflow.com/questions/510462/is-system-nanotime-completely-useless#comment40382219_510940
 has little discussion.

> yarn.util.Clock should not be used to time a duration or time interval
> --
>
> Key: YARN-4177
> URL: https://issues.apache.org/jira/browse/YARN-4177
> Project: Hadoop YARN
>  Issue Type: Bug
>Reporter: Xianyin Xin
>Assignee: Xianyin Xin
> Attachments: YARN-4177.001.patch, YARN-4177.002.patch
>
>
> There're many places uses Clock to time intervals, which is dangerous as 
> commented by [~ste...@apache.org] in HADOOP-12409. Instead, we should use 
> hadoop.util.Timer#monotonicNow() to get monotonic time. Or we could provide a 
> MonotonicClock in yarn.util considering the consistency of code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (YARN-4177) yarn.util.Clock should not be used to time a duration or time interval

2015-09-19 Thread Steve Loughran (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-4177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14877134#comment-14877134
 ] 

Steve Loughran commented on YARN-4177:
--

As of this week, i don't trust monotonic clocks on multi-socket servers: 
http://steveloughran.blogspot.co.uk/2015/09/time-on-multi-core-multi-socket-servers.html



> yarn.util.Clock should not be used to time a duration or time interval
> --
>
> Key: YARN-4177
> URL: https://issues.apache.org/jira/browse/YARN-4177
> Project: Hadoop YARN
>  Issue Type: Bug
>Reporter: Xianyin Xin
>Assignee: Xianyin Xin
> Attachments: YARN-4177.001.patch, YARN-4177.002.patch
>
>
> There're many places uses Clock to time intervals, which is dangerous as 
> commented by [~ste...@apache.org] in HADOOP-12409. Instead, we should use 
> hadoop.util.Timer#monotonicNow() to get monotonic time. Or we could provide a 
> MonotonicClock in yarn.util considering the consistency of code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (YARN-4177) yarn.util.Clock should not be used to time a duration or time interval

2015-09-17 Thread Xianyin Xin (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-4177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14802911#comment-14802911
 ] 

Xianyin Xin commented on YARN-4177:
---

In a following steps I would try to fix several important places where clock is 
misused.

> yarn.util.Clock should not be used to time a duration or time interval
> --
>
> Key: YARN-4177
> URL: https://issues.apache.org/jira/browse/YARN-4177
> Project: Hadoop YARN
>  Issue Type: Bug
>Reporter: Xianyin Xin
> Attachments: YARN-4177.001.patch
>
>
> There're many places uses Clock to time intervals, which is dangerous as 
> commented by [~ste...@apache.org] in HADOOP-12409. Instead, we should use 
> hadoop.util.Timer#monotonicNow() to get monotonic time. Or we could provide a 
> MonotonicClock in yarn.util considering the consistency of code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)