[jira] [Commented] (HADOOP-15670) UserGroupInformation TGT renewer thread doesn't use monotonically increasing time for calculating interval to sleep

2018-08-17 Thread Hrishikesh Gadre (JIRA)


[ 
https://issues.apache.org/jira/browse/HADOOP-15670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16584181#comment-16584181
 ] 

Hrishikesh Gadre commented on HADOOP-15670:
---

{quote}I think we document in our Time class that we don't trust nanotime to be 
very monotonic.
{quote}
Well... the javadoc for Time::now() API clearly states that it should not be 
used for measuring elapsed time and rather Time::monotonicNow() should be used.

https://github.com/apache/hadoop/blob/8d7c93186e3090b19aa59006bb6b32ba929bd8e6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57

> UserGroupInformation TGT renewer thread doesn't use monotonically increasing 
> time for calculating interval to sleep
> ---
>
> Key: HADOOP-15670
> URL: https://issues.apache.org/jira/browse/HADOOP-15670
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: common
>Affects Versions: 3.1.0, 2.9.1
>Reporter: Hrishikesh Gadre
>Assignee: Hrishikesh Gadre
>Priority: Minor
>
> As per the [documentation of Time#now() 
> method|https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57],
>  it should not be used for calculating duration or interval to sleep. But the 
> TGT renewer thread in UserGroupInformation object doesn't follow this 
> recommendation,
> [https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L892-L899]
> This should be fixed to use Time.monotonicNow() API instead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (HADOOP-15670) UserGroupInformation TGT renewer thread doesn't use monotonically increasing time for calculating interval to sleep

2018-08-16 Thread Steve Loughran (JIRA)


[ 
https://issues.apache.org/jira/browse/HADOOP-15670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16583387#comment-16583387
 ] 

Steve Loughran commented on HADOOP-15670:
-

I think we document in our Time class that we don't trust nanotime to be very 
monotonic. 

(Obscure trivia: the WGS84 time of GPS satellites is monotonic, they just also 
broadcast an offset to terrestrial time, which, as leap seconds come and go, 
can change. If you want monotonic: go with WGS84)

> UserGroupInformation TGT renewer thread doesn't use monotonically increasing 
> time for calculating interval to sleep
> ---
>
> Key: HADOOP-15670
> URL: https://issues.apache.org/jira/browse/HADOOP-15670
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: common
>Affects Versions: 3.1.0, 2.9.1
>Reporter: Hrishikesh Gadre
>Assignee: Hrishikesh Gadre
>Priority: Minor
>
> As per the [documentation of Time#now() 
> method|https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57],
>  it should not be used for calculating duration or interval to sleep. But the 
> TGT renewer thread in UserGroupInformation object doesn't follow this 
> recommendation,
> [https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L892-L899]
> This should be fixed to use Time.monotonicNow() API instead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (HADOOP-15670) UserGroupInformation TGT renewer thread doesn't use monotonically increasing time for calculating interval to sleep

2018-08-16 Thread Eric Yang (JIRA)


[ 
https://issues.apache.org/jira/browse/HADOOP-15670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16583182#comment-16583182
 ] 

Eric Yang commented on HADOOP-15670:


[~hgadre] There are configuration in KDC in minutes for Kerberos V5 tolerates 
between the time on the client clock and the time on the domain controller that 
provides Kerberos authentication.  The time difference in nano second and 
milliseconds of the current time stamp is inconsequential to the renewal sleep 
thread because UGI renewal thread always renew minutes ahead of the expiration 
time.  Hence, this is not a real problem.

> UserGroupInformation TGT renewer thread doesn't use monotonically increasing 
> time for calculating interval to sleep
> ---
>
> Key: HADOOP-15670
> URL: https://issues.apache.org/jira/browse/HADOOP-15670
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: common
>Affects Versions: 3.1.0, 2.9.1
>Reporter: Hrishikesh Gadre
>Assignee: Hrishikesh Gadre
>Priority: Minor
>
> As per the [documentation of Time#now() 
> method|https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57],
>  it should not be used for calculating duration or interval to sleep. But the 
> TGT renewer thread in UserGroupInformation object doesn't follow this 
> recommendation,
> [https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L892-L899]
> This should be fixed to use Time.monotonicNow() API instead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (HADOOP-15670) UserGroupInformation TGT renewer thread doesn't use monotonically increasing time for calculating interval to sleep

2018-08-16 Thread Hrishikesh Gadre (JIRA)


[ 
https://issues.apache.org/jira/browse/HADOOP-15670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16583091#comment-16583091
 ] 

Hrishikesh Gadre commented on HADOOP-15670:
---

[~ste...@apache.org] thanks for the feedback and the blog post ! I found this 
evaluation in 
[JDK-6458294|https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6458294]

 
{noformat}
The VM can only use the time sources available to it. If CLOCK_MONOTONIC is not 
supported then there is no monotonic clock available for the VM to use. On such 
systems the VM won't comply with the nanoTime spec. Trying to implement an 
internal monotonic time source based on timestamp counters or direct use of 
timer hardware is simply not feasible. Note even the monotonic clock is allowed 
to jump forward in time. Certainly nanoTime should be no worse than 
currentTimeMillis() and so should always be preferred for doing timing 
measurements - except when trying to measure something that is inherently tied 
to the time-of-day clock.{noformat}
 

So from the JVM perspective, the recommendation is still to use nanoTime() for 
measuring elapsed time instead of currentTimeInMillis(). In regards to this 
jira, I don't have a strong opinion if we should make this change or to close 
it as "Won't Fix". What do you think?

 

> UserGroupInformation TGT renewer thread doesn't use monotonically increasing 
> time for calculating interval to sleep
> ---
>
> Key: HADOOP-15670
> URL: https://issues.apache.org/jira/browse/HADOOP-15670
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: common
>Affects Versions: 3.1.0, 2.9.1
>Reporter: Hrishikesh Gadre
>Assignee: Hrishikesh Gadre
>Priority: Minor
>
> As per the [documentation of Time#now() 
> method|https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57],
>  it should not be used for calculating duration or interval to sleep. But the 
> TGT renewer thread in UserGroupInformation object doesn't follow this 
> recommendation,
> [https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L892-L899]
> This should be fixed to use Time.monotonicNow() API instead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (HADOOP-15670) UserGroupInformation TGT renewer thread doesn't use monotonically increasing time for calculating interval to sleep

2018-08-16 Thread Steve Loughran (JIRA)


[ 
https://issues.apache.org/jira/browse/HADOOP-15670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16582127#comment-16582127
 ] 

Steve Loughran commented on HADOOP-15670:
-

Time.monotonicNow() isn't monotonic across sockets; even across cores in some 
CPU parts

see: 
http://steveloughran.blogspot.com/2015/09/time-on-multi-core-multi-socket-servers.html



> UserGroupInformation TGT renewer thread doesn't use monotonically increasing 
> time for calculating interval to sleep
> ---
>
> Key: HADOOP-15670
> URL: https://issues.apache.org/jira/browse/HADOOP-15670
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: common
>Affects Versions: 3.1.0, 2.9.1
>Reporter: Hrishikesh Gadre
>Assignee: Hrishikesh Gadre
>Priority: Minor
>
> As per the [documentation of Time#now() 
> method|https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java#L49-L57],
>  it should not be used for calculating duration or interval to sleep. But the 
> TGT renewer thread in UserGroupInformation object doesn't follow this 
> recommendation,
> [https://github.com/apache/hadoop/blob/74411ce0ce7336c0f7bb5793939fdd64a5dcdef6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L892-L899]
> This should be fixed to use Time.monotonicNow() API instead.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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