You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "zhihai xu (JIRA)" <ji...@apache.org> on 2015/01/29 21:51:35 UTC

[jira] [Created] (YARN-3114) It would be better to consider integer(long) overflow when compare the time in DelegationTokenRenewer.

zhihai xu created YARN-3114:
-------------------------------

             Summary: 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


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)