Skip to content

YARN-11995. Preserve custom resource allocations in timeline container history - #8770

Merged
slfan1989 merged 4 commits into
apache:trunkfrom
gerashegalov:YARN-11995
Oct 10, 2026
Merged

slfan1989 merged 4 commits into
apache:trunkfrom
gerashegalov:YARN-11995

Conversation

@gerashegalov

@gerashegalov gerashegalov commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Description of PR

Fixes YARN-11995.

Container history currently drops custom allocations such as yarn.io/gpu: the timeline publishers store only memory and vcores, and the history readers reconstruct a two-resource report. An allocation of two GPUs therefore appears as zero in history.

Persist nonzero custom allocation values and units in the additive YARN_CONTAINER_ALLOCATED_RESOURCES info field. Update both ResourceManager timeline publishers, the NodeManager v2 publisher, and both history report converters. The publishers omit the field when no nonzero custom allocation exists, including on clusters with configured but unused resource types.

Shared helpers snapshot allocations before asynchronous publication and convert stored units to the reader's configured units. Readers skip unknown types at DEBUG and skip malformed allocations individually, preserving later valid entries. Integral values are checked for range and precision; floating-point values are skipped because JSON decoding may already have rounded them.

Existing memory/vcore fields and legacy entities remain compatible. History servers and standalone clients need the same resource-type configuration to include custom allocations in reports. Allocations omitted by older publishers cannot be recovered retroactively. The pre-existing shared unit-conversion overflow is tracked separately in YARN-12007.

How was this patch tested?

  • The original patch passed 107 tests on JDK 17, with zero failures, errors, or skips, across TestTimelineServiceHelper, TestSystemMetricsPublisher, TestSystemMetricsPublisherForV2, TestNMTimelinePublisher, TestApplicationHistoryManagerOnTimelineStore, TestAHSWebServices, and TestAHSv2ClientImpl.
  • The review-feedback update passed 29 targeted pure-Java tests (5 common, 11 RM v1, 6 RM v2, and 7 NM) with -Dmaven.test.failure.ignore=false and zero failures, errors, or skips.
  • Coverage includes JSON/store round trips, single-container and list REST responses, GPU and other custom resources, omitted zero allocations, large values, unit conversion, legacy entities, unknown resource types, malformed entries, and source-mutation isolation.
  • Additional standalone probes for the original patch passed for the generic storage codec, creation/finish entity merging, container-report protobuf serialization, and fresh-JVM loading of resource-types.xml.
  • git diff --check passed. The original patch's checkstyle run reported 45 existing diagnostics in the checked files, none on changed lines; checkstyle has not been rerun locally for the feedback update.
  • A live HBase-backed ATSv2 cluster test was not run. Remote CI was triggered on the feedback commit; see the current checks.

For code changes:

  • Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: Have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation? Note: Automated CI
    testing doesn't cover all cases so manual testing with cloud storage is still
    required.
    Not applicable: no object storage changes.
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0? Not applicable: no new dependencies.
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files? Not applicable: no licensing changes.

AI Tooling

Contains content generated by OpenAI Codex.

If an AI tool was used:

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 7m 5s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 markdownlint 0m 1s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 3s Maven dependency ordering for branch
+1 💚 mvninstall 27m 24s trunk passed
+1 💚 compile 3m 31s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 3m 44s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 26s trunk passed
+1 💚 mvnsite 4m 27s trunk passed
+1 💚 javadoc 4m 6s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 3m 55s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 36s branch/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site no spotbugs output file (spotbugsXml.xml)
-1 ❌ spotbugs 1m 5s /branch-spotbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant spotbugs warnings.
+1 💚 shadedclient 17m 13s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 2m 28s the patch passed
+1 💚 compile 3m 20s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 3m 20s the patch passed
+1 💚 compile 3m 25s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 3m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 23s the patch passed
+1 💚 mvnsite 4m 2s the patch passed
+1 💚 javadoc 3m 37s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 3m 41s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 24s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site has no data from spotbugs
+1 💚 shadedclient 15m 47s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 30s hadoop-yarn-common in the patch passed.
+1 💚 unit 2m 54s hadoop-yarn-server-applicationhistoryservice in the patch passed.
+1 💚 unit 91m 16s hadoop-yarn-server-resourcemanager in the patch passed.
-1 ❌ unit 23m 56s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager.txt hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 25m 37s hadoop-yarn-client in the patch passed.
+1 💚 unit 0m 25s hadoop-yarn-site in the patch passed.
+1 💚 asflicense 0m 45s The patch does not generate ASF License warnings.
279m 7s
Reason Tests
Failed junit tests hadoop.yarn.server.nodemanager.containermanager.logaggregation.TestLogAggregationService
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/1/artifact/out/Dockerfile
GITHUB PR #8770
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets markdownlint
uname Linux f68e7bd69b43 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d715d9f
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/1/testReport/
Max. process+thread count 968 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site U: hadoop-yarn-project/hadoop-yarn
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/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.

@gerashegalov

Copy link
Copy Markdown
Contributor Author

CI update for Jenkins run #1: The fork Build passes, and the changed TestNMTimelinePublisher tests pass (6/6). Yetus reports two NodeManager failures that appear unrelated to this patch:

  • SpotBugs: Trunk has one existing NP_NULL_ON_SOME_PATH_EXCEPTION warning in ResourceLocalizationService$PublicLocalizer.run(); this patch adds no new warnings. YARN-11993 / PR #8755 addresses it.
  • Unit test: TestLogAggregationService.testLocalFileDeletionAfterUpload fails because the application log directory still exists when asserted. The test waits for individual files, but not for the independently scheduled directory deletion. This failed on all three attempts in this run. HADOOP-19979 / PR #8717 adds the missing wait.

Neither failing path is changed by this PR. Once those fixes land, a fresh CI run should establish whether any failures remain.

@gerashegalov gerashegalov self-assigned this Oct 2, 2026
@slfan1989

Copy link
Copy Markdown
Contributor

CI update for Jenkins run #1: The fork Build passes, and the changed TestNMTimelinePublisher tests pass (6/6). Yetus reports two NodeManager failures that appear unrelated to this patch:

  • SpotBugs: Trunk has one existing NP_NULL_ON_SOME_PATH_EXCEPTION warning in ResourceLocalizationService$PublicLocalizer.run(); this patch adds no new warnings. YARN-11993 / PR #8755 addresses it.
  • Unit test: TestLogAggregationService.testLocalFileDeletionAfterUpload fails because the application log directory still exists when asserted. The test waits for individual files, but not for the independently scheduled directory deletion. This failed on all three attempts in this run. HADOOP-19979 / PR #8717 adds the missing wait.

Neither failing path is changed by this PR. Once those fixes land, a fresh CI run should establish whether any failures remain.

@gerashegalov Thanks for inviting me to review this PR! I'll take another look. I suggest merging #8776 and #8779 first, as they address unrelated flaky YARN tests that can cause CI failures. This should help stabilize the CI baseline and make it easier to assess this PR's results.

Thanks for your patience!

@slfan1989

Copy link
Copy Markdown
Contributor

PRs #8776 and #8779 have been merged. I’ve triggered a new Jenkins precommit run against the latest trunk to check whether the CI failures are resolved.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 7m 6s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 1m 48s Maven dependency ordering for branch
+1 💚 mvninstall 26m 22s trunk passed
+1 💚 compile 3m 36s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 3m 29s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 30s trunk passed
+1 💚 mvnsite 4m 19s trunk passed
+1 💚 javadoc 4m 8s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 4m 8s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 35s branch/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 16m 56s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for patch
+1 💚 mvninstall 2m 28s the patch passed
+1 💚 compile 3m 16s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 3m 16s the patch passed
+1 💚 compile 3m 32s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 3m 32s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 16s the patch passed
+1 💚 mvnsite 3m 58s the patch passed
+1 💚 javadoc 3m 41s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 3m 37s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 26s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site has no data from spotbugs
+1 💚 shadedclient 15m 53s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 35s hadoop-yarn-common in the patch passed.
+1 💚 unit 3m 19s hadoop-yarn-server-applicationhistoryservice in the patch passed.
+1 💚 unit 90m 44s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 22m 38s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 25m 4s hadoop-yarn-client in the patch passed.
+1 💚 unit 0m 23s hadoop-yarn-site in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
275m 17s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/2/artifact/out/Dockerfile
GITHUB PR #8770
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets markdownlint
uname Linux 6d622352cea3 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d715d9f
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/2/testReport/
Max. process+thread count 967 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site U: hadoop-yarn-project/hadoop-yarn
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/2/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.

@slfan1989

Copy link
Copy Markdown
Contributor

@gerashegalov The latest Jenkins/Yetus run is green. The two remaining red checks appear to be stale statuses from the previous build.

Could you push an empty commit to retrigger CI on a new commit SHA? This should prevent the stale statuses from carrying over.

@joseluisll joseluisll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough patch and tests. Routing every reader through TimelineUtils.getContainerResource is a nice cleanup, and moving off the (Integer) casts also fixes a latent ClassCastException once memory comes back from JSON as a Long. I've left a few inline suggestions in TimelineUtils.

LOG.warn("Skipping unknown resource type {} in container history", name);
continue;
}
Map<?, ?> allocation = (Map<?, ?>) entry.getValue();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make per-entry parsing tolerant of bad data

This loop has no error handling, so one malformed entry fails the whole conversion:

  • a missing value gives an NPE;
  • a value or units of an unexpected type gives a ClassCastException;
  • an unknown unit, or a unit conversion that overflows, gives an IllegalArgumentException from UnitsConversionUtil.convert.

Unknown resource types already get "warn and skip". I think bad entries deserve the same treatment instead of failing the request. Otherwise one bad entry breaks the container report, and on the list endpoints it breaks every container of the attempt. Something like:

try {
  Map<?, ?> allocation = (Map<?, ?>) entry.getValue();
  long value = ((Number) allocation.get("value")).longValue();
  String units = (String) allocation.get("units");
  String defaultUnits = resource.getResourceInformation(name).getUnits();
  resource.setResourceValue(name,
      UnitsConversionUtil.convert(units, defaultUnits, value));
} catch (RuntimeException e) {
  LOG.debug("Skipping malformed allocation for resource type {}", name, e);
}

A small test with a missing value and with an unknown unit would cover it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the concrete cases. Addressed in 48b26fe: malformed custom entries are skipped independently so later valid allocations survive. The tests cover missing values, invalid shapes, unknown units, conversion overflow, and invalid numeric values. The separate pre-existing UnitsConversionUtil issue is tracked as YARN-12007.

continue;
}
if (!ResourceUtils.getResourceTypes().containsKey(name)) {
LOG.warn("Skipping unknown resource type {} in container history", name);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid log spam for unknown resource types

This warning runs for every container on every read. For example, take an AHS without resource-types.xml that serves a container list for a large app. It would write one warning per container per request. Could we log this at DEBUG, or warn only once per resource type (e.g. track the names already reported in a ConcurrentHashMap.newKeySet())?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 48b26fe: unknown resource types now log at DEBUG rather than WARN, and both timeline docs match.

}

@Private
public static Map<String, Map<String, Object>> getCustomResourceInfo(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip the field when there are no custom resources

This always returns a map, and the publishers always put it. So on clusters without custom resources, every container entity gets an empty YARN_CONTAINER_ALLOCATED_RESOURCES: {}. That's an extra column per container in ATSv2/HBase and extra bytes in ATSv1. Readers already handle the field being absent, so the publishers could skip the put when the map is empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 48b26fe: all three publishers omit the field for an empty custom-resource map. The helper also omits zero-valued custom types, so even a configured but unused GPU type adds no field. RM v1, RM v2, and NM tests assert the field is absent.

@gerashegalov
gerashegalov requested a review from tgravescs October 5, 2026 19:34
Generated-by: OpenAI Codex
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 27s Maven dependency ordering for branch
+1 💚 mvninstall 27m 48s trunk passed
+1 💚 compile 3m 32s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 3m 34s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 29s trunk passed
+1 💚 mvnsite 4m 28s trunk passed
+1 💚 javadoc 4m 3s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 4m 6s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 32s branch/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 16m 43s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 2m 36s the patch passed
+1 💚 compile 3m 13s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 3m 13s the patch passed
+1 💚 compile 3m 31s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 3m 31s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 24s /results-checkstyle-hadoop-yarn-project_hadoop-yarn.txt hadoop-yarn-project/hadoop-yarn: The patch generated 1 new + 44 unchanged - 0 fixed = 45 total (was 44)
+1 💚 mvnsite 4m 2s the patch passed
+1 💚 javadoc 3m 41s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 3m 41s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 27s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site has no data from spotbugs
+1 💚 shadedclient 16m 4s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 35s hadoop-yarn-common in the patch passed.
+1 💚 unit 3m 17s hadoop-yarn-server-applicationhistoryservice in the patch passed.
+1 💚 unit 91m 36s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 23m 21s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 25m 11s hadoop-yarn-client in the patch passed.
+1 💚 unit 0m 32s hadoop-yarn-site in the patch passed.
+1 💚 asflicense 0m 50s The patch does not generate ASF License warnings.
272m 56s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/3/artifact/out/Dockerfile
GITHUB PR #8770
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets markdownlint
uname Linux 5dd722c77906 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 48b26fe
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/3/testReport/
Max. process+thread count 906 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site U: hadoop-yarn-project/hadoop-yarn
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/3/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.

Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 1s Maven dependency ordering for branch
+1 💚 mvninstall 27m 3s trunk passed
+1 💚 compile 3m 34s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 3m 40s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 31s trunk passed
+1 💚 mvnsite 4m 27s trunk passed
+1 💚 javadoc 4m 10s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 4m 5s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 36s branch/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 17m 12s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 27s Maven dependency ordering for patch
+1 💚 mvninstall 2m 31s the patch passed
+1 💚 compile 3m 11s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 3m 11s the patch passed
+1 💚 compile 3m 29s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 3m 29s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 23s the patch passed
+1 💚 mvnsite 4m 4s the patch passed
+1 💚 javadoc 3m 31s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 3m 40s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 26s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site has no data from spotbugs
+1 💚 shadedclient 16m 3s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 35s hadoop-yarn-common in the patch passed.
+1 💚 unit 3m 18s hadoop-yarn-server-applicationhistoryservice in the patch passed.
+1 💚 unit 92m 7s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 23m 20s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 25m 5s hadoop-yarn-client in the patch passed.
+1 💚 unit 0m 31s hadoop-yarn-site in the patch passed.
+1 💚 asflicense 0m 50s The patch does not generate ASF License warnings.
273m 12s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/4/artifact/out/Dockerfile
GITHUB PR #8770
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets markdownlint
uname Linux 4f438f19eeea 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4de2db2
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/4/testReport/
Max. process+thread count 944 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site U: hadoop-yarn-project/hadoop-yarn
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/4/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.

@joseluisll joseluisll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround. 48b26fe addresses all three earlier points. A bad entry now skips only itself, unknown types log at DEBUG, and the publishers leave out the field when there's nothing to store. The tests cover the edge cases well. I've left a few small suggestions inline. None of them blocks this. +1 (non-binding).

&& !ResourceInformation.VCORES_URI.equals(name)
&& information.getValue() != 0) {
Map<String, Object> allocation = new HashMap<>();
allocation.put("value", information.getValue());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, which I should have caught on the first pass: "value" and "units" are spelled out separately by the writer (getCustomResourceInfo) and the reader (getContainerResource). They're part of the stored format now, so could they be constants next to ALLOCATED_RESOURCES_INFO in ContainerMetricsConstants? That way writer and reader can't drift apart.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks—addressed in d60acf7. value and units now have shared constants in ContainerMetricsConstants, used by both the writer and reader. The stored field names are unchanged.

}

@Private
public static Map<String, Map<String, Object>> getCustomResourceInfo(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, also from the first pass: A short Javadoc on these two public helpers would help. On getCustomResourceInfo it could show the map shape (name -> {value, units}, leaving out memory, vcores and zero values). On getContainerResource it could say that unknown or malformed entries are skipped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Javadocs in d60acf7 describing the stored map shape, omitted allocations, and how the reader handles unknown or malformed entries.

String defaultUnits = resource.getResourceInformation(name).getUnits();
resource.setResourceValue(name,
UnitsConversionUtil.convert(units, defaultUnits, value));
} catch (ClassCastException | NullPointerException

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: Following up on my earlier suggestion: listing the four exceptions covers today's code paths. A single catch (RuntimeException e) would also cover anything not listed, such as a ResourceNotFoundException from getResourceInformation, which is what a per-entry skip guard is for. Feel free to leave as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the optional suggestion. I’d keep the specific catches here: after the configured-type check, a ResourceNotFoundException would indicate inconsistent resource metadata rather than a malformed stored entry, so silently skipping it could hide a separate problem.

Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 23s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 23s Maven dependency ordering for branch
+1 💚 mvninstall 27m 50s trunk passed
+1 💚 compile 3m 35s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 3m 34s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 27s trunk passed
+1 💚 mvnsite 4m 21s trunk passed
+1 💚 javadoc 4m 12s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 4m 4s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 35s branch/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 17m 1s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for patch
+1 💚 mvninstall 2m 31s the patch passed
+1 💚 compile 3m 21s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 3m 21s the patch passed
+1 💚 compile 3m 53s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 3m 53s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 19s the patch passed
+1 💚 mvnsite 3m 33s the patch passed
+1 💚 javadoc 3m 13s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 2m 54s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+0 🆗 spotbugs 0m 21s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site has no data from spotbugs
+1 💚 shadedclient 17m 7s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 31s hadoop-yarn-common in the patch passed.
+1 💚 unit 3m 6s hadoop-yarn-server-applicationhistoryservice in the patch passed.
+1 💚 unit 91m 42s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 22m 58s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 24m 34s hadoop-yarn-client in the patch passed.
+1 💚 unit 0m 23s hadoop-yarn-site in the patch passed.
+1 💚 asflicense 0m 46s The patch does not generate ASF License warnings.
270m 49s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/5/artifact/out/Dockerfile
GITHUB PR #8770
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets markdownlint
uname Linux 170a84b33855 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d60acf7
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/5/testReport/
Max. process+thread count 953 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site U: hadoop-yarn-project/hadoop-yarn
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8770/5/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.

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gerashegalov Thanks for the contribution! LGTM.

The patch covers all three timeline publishers and both history report converters while preserving compatibility with existing memory/vcore fields and legacy entities. Malformed custom allocations are skipped individually, and the new field is omitted when no nonzero custom allocation exists.

I checked out the current PR head and ran the seven related test classes on Java 17: all 112 tests passed, with zero failures, errors, or skipped tests. Build and Yetus are also green.

The resource-type configuration requirement and limitations for older history data are clearly documented.

From my side, this PR is ready to merge whenever you’re ready.

@gerashegalov

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing @joseluisll @slfan1989

@slfan1989 would you mind merging the PR if there are no more comments?

@slfan1989
slfan1989 merged commit 7d8dc18 into apache:trunk Oct 10, 2026
6 checks passed
@slfan1989

Copy link
Copy Markdown
Contributor

Merged. Thanks, @gerashegalov, for the contribution, and @joseluisll for reviewing!

@gerashegalov, should we also backport this change to branch-3.4?

@gerashegalov

Copy link
Copy Markdown
Contributor Author

Thank you @slfan1989 . I think it would be great to backport to branch-3.4, which hopefully speeds up its delivery to customers if the effort is reasonable. I can work on it next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants