hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhihai xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-3114) It would be better to consider integer(long) overflow when compare the time in DelegationTokenRenewer.
Date Thu, 29 Jan 2015 21:47:35 GMT

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

zhihai xu commented on YARN-3114:
---------------------------------

Thanks for the review. Ok, you are right. The code won't be used until the time become Long.MAX_VALUE,
which may not happen unless the system time is corrupted due to un-expected error from OS,
Hardware, Time server...
My change can work better with error system time and the test code is to prove this error
condition and I should remove it.


> It would be better to consider integer(long) overflow when compare the time in DelegationTokenRenewer.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-3114
>                 URL: https://issues.apache.org/jira/browse/YARN-3114
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: resourcemanager
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>            Priority: Minor
>         Attachments: YARN-3114.000.patch
>
>
> It would be better to consider integer(long) overflow when compare the time in DelegationTokenRenewer.
> When compare time in DelegationTokenRenewer#DelayedTokenRemovalRunnable to cancel token
, it will have problem when currentTimeMillis is close to Long.MAX_VALUE.
> The safer way to compare time will compare the time difference:
> change
> {code}
> if (e.getValue() < System.currentTimeMillis()) {
> {code}
> to 
> {code}
> if (e.getValue() - System.currentTimeMillis() < 0) {
> {code}



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

Mime
View raw message