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 "liu bin (Jira)" <ji...@apache.org> on 2022/07/22 09:13:00 UTC

[jira] [Updated] (YARN-11213) DecommissioningNodesWatcher#logDecommissioningNodesStatus calculate app elapsed time error

     [ https://issues.apache.org/jira/browse/YARN-11213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

liu bin updated YARN-11213:
---------------------------
    Description: 
There is a calculation in DecommissioningNodesWatcher#logDecommissioningNodesStatus to calculate app elapsed time:
{code:java}
(mclock.getTime() - rmApp.getStartTime()) / 1000{code}
But mclock.getTime() is generated from System.nanoTime() / NANOSECONDS_PER_MILLISECOND,

rmApp.getStartTime() is generated from System.currentTimeMillis(), they cannot be compared.

This calculation should be:
{code:java}
(System.currentTimeMillis() - rmApp.getStartTime()) / 1000{code}

  was:
There is a calculation in DecommissioningNodesWatcher#logDecommissioningNodesStatus to calculate app elapsed time:
{code:java}
(mclock.getTime() - rmApp.getStartTime()) / 1000{code}
But mclock.getTime() is get from System.nanoTime() / NANOSECONDS_PER_MILLISECOND, rmApp.getStartTime() is get from System.currentTimeMillis(), they cannot be compared.

This calculation should be:
{code:java}
(System.currentTimeMillis() - rmApp.getStartTime()) / 1000{code}


> DecommissioningNodesWatcher#logDecommissioningNodesStatus calculate app elapsed time error
> ------------------------------------------------------------------------------------------
>
>                 Key: YARN-11213
>                 URL: https://issues.apache.org/jira/browse/YARN-11213
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: liu bin
>            Priority: Minor
>
> There is a calculation in DecommissioningNodesWatcher#logDecommissioningNodesStatus to calculate app elapsed time:
> {code:java}
> (mclock.getTime() - rmApp.getStartTime()) / 1000{code}
> But mclock.getTime() is generated from System.nanoTime() / NANOSECONDS_PER_MILLISECOND,
> rmApp.getStartTime() is generated from System.currentTimeMillis(), they cannot be compared.
> This calculation should be:
> {code:java}
> (System.currentTimeMillis() - rmApp.getStartTime()) / 1000{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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