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 "Eric Payne (Jira)" <ji...@apache.org> on 2022/09/01 19:52:00 UTC

[jira] [Commented] (YARN-9019) Ratio calculation of ResourceCalculator implementations could return NaN

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

Eric Payne commented on YARN-9019:
----------------------------------

I'd like to backport this to 3.2 and 2.10.

> Ratio calculation of ResourceCalculator implementations could return NaN
> ------------------------------------------------------------------------
>
>                 Key: YARN-9019
>                 URL: https://issues.apache.org/jira/browse/YARN-9019
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Major
>             Fix For: 3.3.0
>
>         Attachments: YARN-9019.001.patch
>
>
> Found out that ResourceCalculator.ratio (with implementors DefaultResourceCalculator and DominantResourceCalculator) can produce NaN (Not-A-Number) as a result.
> This is because [IEEE 754|http://grouper.ieee.org/groups/754/] defines {{1.0 / 0.0}} as Infinity and {{-1.0 / 0.0}} as -Infinity and {{0.0 / 0.0}} as NaN, see here: [https://stackoverflow.com/a/14138032/1106893] 
> I think it's very dangerous to rely on NaN can be returned from ratio calculations and this could have side-effects.
> When ratio calculates the result and if both the numerator and the denominator is zero, we should use 0 as a result, I think.



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