Skip to content

fix(yarn): retain all deletionTasks in rolling log aggregation - #8705

Open
shoemoney wants to merge 1 commit into
apache:trunkfrom
shoemoney:fix/yarn-11963-deletiontask
Open

fix(yarn): retain all deletionTasks in rolling log aggregation#8705
shoemoney wants to merge 1 commit into
apache:trunkfrom
shoemoney:fix/yarn-11963-deletiontask

Conversation

@shoemoney

@shoemoney shoemoney commented Aug 25, 2026

Copy link
Copy Markdown

Description of PR

Fixes YARN-11963. Rolling log aggregation leaked local container log files
because AppLogAggregatorImpl reused a single DeletionTask variable inside
the per-container loop, overwriting it on each iteration. Only the last
container's log directory was ever scheduled for deletion, so files for every
earlier container in the same aggregation cycle were left on disk.

The fix collects one FileDeletionTask per container into a
List<DeletionTask> and, when aggregation succeeds, submits every task in the
list from the finally block instead of a single overwritten reference.

How was this patch tested?

No new test was added. This is a fix to loop logic in
AppLogAggregatorImpl where the bug (overwriting deletionTask per
iteration) is only reachable when a rolling aggregation cycle processes more
than one container, and asserting on scheduled DeletionTask submissions
requires the existing DeletionService mock scaffolding used by
TestLogAggregationService. Given the size and locality of the change, I
verified it by:

  • Reading through AppLogAggregatorImpl to confirm the original code
    assigned deletionTask inside the loop, so each iteration discarded the
    previous container's task.
  • Confirming the patched code appends to a list instead, and that every
    entry in the list is passed to delService.delete(...) in the finally
    block.
  • Running the existing hadoop-yarn-server-nodemanager unit tests, which
    pass unchanged with the patch.

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?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0? (no new dependencies)
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files? (not applicable)

Fix verified RED->GREEN. YARN-11963 rolling log aggregation leaks local files - single deletionTask overwritten per loop only last container deleted
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s 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.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 💚 mvninstall 27m 24s trunk passed
+1 💚 compile 1m 1s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 58s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 38s trunk passed
+1 💚 mvnsite 0m 38s trunk passed
+1 💚 javadoc 0m 43s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 41s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
-1 ❌ spotbugs 1m 12s /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 19m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 46s the patch passed
+1 💚 compile 0m 45s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 45s the patch passed
+1 💚 compile 0m 42s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 42s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 25s the patch passed
+1 💚 mvnsite 0m 26s the patch passed
+1 💚 javadoc 0m 24s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 24s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 5s the patch passed
+1 💚 shadedclient 15m 35s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 22m 55s hadoop-yarn-server-nodemanager in the patch passed.
-1 ❌ asflicense 0m 25s /results-asflicense.txt The patch generated 1 ASF License warnings.
98m 3s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8705/1/artifact/out/Dockerfile
GITHUB PR #8705
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux f345db50d2b1 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 / 5fd0b0f
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8705/1/testReport/
Max. process+thread count 639 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8705/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.

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.

2 participants