[
https://issues.apache.org/jira/browse/YARN-11325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611751#comment-17611751
]
FuzzingTeam commented on YARN-11325:
------------------------------------
A similar check to handle the _subtractTestNonNegative_ operator exists in
another method ({_}negate{_}) in the same class, but it is missing in the
_combineValue_ method while dealing with {*}null value of the operand eA{*}.
*Code snippet of where the check for the* *subtractTestNonNegative* *operator*
*is missing:*
{code:java}
private static Resource combineValue(RLEOperator op,
ResourceCalculator resCalc, Resource clusterResource,
Entry<Long, Resource> eA, Entry<Long, Resource> eB)
throws PlanningException {
// deal with null
if (eA == null || eA.getValue() == null) {
if (eB == null || eB.getValue() == null) {
return null;
}
if (op == RLEOperator.subtract) {
return Resources.negate(eB.getValue());
} else {
return eB.getValue();
}
}
if (eB == null || eB.getValue() == null) {
return eA.getValue();
} {code}
{*}Solution{*}:- We propose to add a required check when the operator is
_subtractTestNonNegative_ to avoid any incorrect results.
> Missing handling of operator “subtractTestNonNegative” in class
> “RLESparseResourceAllocation”
> ----------------------------------------------------------------------------------------------
>
> Key: YARN-11325
> URL: https://issues.apache.org/jira/browse/YARN-11325
> Project: Hadoop YARN
> Issue Type: Bug
> Components: resourcemanager
> Affects Versions: 3.3.4
> Reporter: FuzzingTeam
> Priority: Major
> Labels: pull-request-available
>
> The handling for the _subtractTestNonNegative_ operator is missing in the
> _combineValue_ method of the _RLESparseResourceAllocation_ class, which
> results in incorrect output.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]