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

Weiwei Yang commented on YARN-7461:
-----------------------------------

Hi [~Tao Yang]

Thanks for providing the fix. Since we are calculating the ratio for 
portion_resource/all_resource in the scheduler, I don't think we expect any 
case that rhs is zero but lhs is non-zero. Even this happens, return an 
INFINITY value is following the old behavior, so I think it is a safe change.
+1 to the patch, [~templedf] do you want to take a look at least patch? I you 
don't have any more comments, I will commit this by end of tomorrow.

Thanks.

> DominantResourceCalculator#ratio calculation problem when right resource 
> contains zero value
> --------------------------------------------------------------------------------------------
>
>                 Key: YARN-7461
>                 URL: https://issues.apache.org/jira/browse/YARN-7461
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha4
>            Reporter: Tao Yang
>            Assignee: Tao Yang
>            Priority: Minor
>         Attachments: YARN-7461.001.patch, YARN-7461.002.patch, 
> YARN-7461.003.patch
>
>
> Currently DominantResourceCalculator#ratio may return wrong result when right 
> resource contains zero value. For example, there are three resource types 
> such as <memory-mb, vcores, vssd>, leftResource=<5, 5, 0> and 
> rightResource=<10, 10, 0>, we expect the result of 
> DominantResourceCalculator#ratio(leftResource, rightResource) is 0.5 but 
> currently is NaN.
> There should be a verification before divide calculation to ensure that 
> dividend is not zero.



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

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

Reply via email to