[
https://issues.apache.org/jira/browse/YARN-11964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18082542#comment-18082542
]
ASF GitHub Bot commented on YARN-11964:
---------------------------------------
hadoop-yetus commented on PR #8506:
URL: https://github.com/apache/hadoop/pull/8506#issuecomment-4507027401
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Logfile | Comment |
|:----:|----------:|--------:|:--------:|:-------:|
| +0 :ok: | reexec | 0m 59s | | Docker mode activated. |
|||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | | No case conflicting files
found. |
| +0 :ok: | codespell | 0m 1s | | codespell was not available. |
| +0 :ok: | detsecrets | 0m 1s | | detect-secrets was not available.
|
| +1 :green_heart: | @author | 0m 0s | | The patch does not contain
any @author tags. |
| -1 :x: | test4tests | 0m 0s | | The patch doesn't appear to include
any new or modified tests. Please justify why no new tests are needed for this
patch. Also please list what manual steps were performed to verify this patch.
|
|||| _ trunk Compile Tests _ |
| +1 :green_heart: | mvninstall | 42m 3s | | trunk passed |
| +1 :green_heart: | compile | 1m 12s | | trunk passed with JDK
Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | compile | 1m 11s | | trunk passed with JDK
Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | checkstyle | 0m 57s | | trunk passed |
| +1 :green_heart: | mvnsite | 1m 15s | | trunk passed |
| +1 :green_heart: | javadoc | 1m 10s | | trunk passed with JDK
Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javadoc | 1m 6s | | trunk passed with JDK
Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | spotbugs | 2m 56s | | trunk passed |
| +1 :green_heart: | shadedclient | 30m 50s | | branch has no errors
when building and testing our client artifacts. |
|||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 0m 41s | | the patch passed |
| +1 :green_heart: | compile | 0m 42s | | the patch passed with JDK
Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javac | 0m 42s | | the patch passed |
| +1 :green_heart: | compile | 0m 41s | | the patch passed with JDK
Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | javac | 0m 41s | | the patch passed |
| +1 :green_heart: | blanks | 0m 0s | | The patch has no blanks
issues. |
| +1 :green_heart: | checkstyle | 0m 20s | | the patch passed |
| +1 :green_heart: | mvnsite | 0m 43s | | the patch passed |
| +1 :green_heart: | javadoc | 0m 36s | | the patch passed with JDK
Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javadoc | 0m 35s | | the patch passed with JDK
Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | spotbugs | 2m 27s | | the patch passed |
| +1 :green_heart: | shadedclient | 29m 18s | | patch has no errors
when building and testing our client artifacts. |
|||| _ Other Tests _ |
| +1 :green_heart: | unit | 0m 56s | | hadoop-yarn-api in the patch
passed. |
| +1 :green_heart: | asflicense | 0m 36s | | The patch does not
generate ASF License warnings. |
| | | 120m 26s | | |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.54 ServerAPI=1.54 base:
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8506/1/artifact/out/Dockerfile
|
| GITHUB PR | https://github.com/apache/hadoop/pull/8506 |
| Optional Tests | dupname asflicense compile javac javadoc mvninstall
mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
| uname | Linux bb62f6878899 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6
13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev-support/bin/hadoop.sh |
| git revision | trunk / ba97cc7a4f63543598c4d72279e68468543f81b9 |
| Default Java | Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| Multi-JDK versions |
/usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04
/usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| Test Results |
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8506/1/testReport/ |
| Max. process+thread count | 636 (vs. ulimit of 10000) |
| modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api U:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api |
| Console output |
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8506/1/console |
| versions | git=2.43.0 maven=3.9.15 spotbugs=4.9.7 |
| Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
This message was automatically generated.
> Resource.castToIntSafely() should clamp negative values to 0 to prevent
> propagation of invalid resource counts
> --------------------------------------------------------------------------------------------------------------
>
> Key: YARN-11964
> URL: https://issues.apache.org/jira/browse/YARN-11964
> Project: Hadoop YARN
> Issue Type: Bug
> Components: resourcemanager
> Affects Versions: 3.4.3
> Reporter: Ryu Kobayashi
> Assignee: Ryu Kobayashi
> Priority: Minor
> Labels: pull-request-available
>
> h2. Problem
> Resource.castToIntSafely() clamps values exceeding Integer.MAX_VALUE to
> Integer.MAX_VALUE,
> but silently passes through negative values. The method comment states
> "This method assumes resource value is positive", however this assumption
> is not guaranteed in practice.
> When YARN RM temporarily reports negative available resources
> (e.g. due to overload, node failures, or transient resource calculation
> errors),
> the negative value is propagated as-is to callers.
> h2. Root Cause
> The method only guards against positive overflow:
> {code:java}
> protected static int castToIntSafely(long value) {
> if (value > Integer.MAX_VALUE) {
> return Integer.MAX_VALUE;
> }
> return Long.valueOf(value).intValue();
> }
> {code}
> There is no guard for negative values. When a negative long is passed,
> it is returned as a negative int, which can cause unexpected behavior
> in downstream components that assume resource values are non-negative.
> h2. Impact
> Downstream components that rely on this method receiving a non-negative int
> may compute invalid results (e.g. negative slot counts, illegal collection
> sizes)
> when YARN temporarily reports negative available resources.
> h2. Fix
> Return 0 when value < 0, consistent with the existing behavior of
> clamping out-of-range values to a safe boundary:
> {code:java}
> protected static int castToIntSafely(long value) {
> if (value < 0) {
> return 0;
> }
> if (value > Integer.MAX_VALUE) {
> return Integer.MAX_VALUE;
> }
> return Long.valueOf(value).intValue();
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]