Skip to content

HADOOP-18639 DockerContainerDeletionTask is not removed from the Nodemanager's statestore when the task is completed - #5425

Closed
Sejin-Hwang wants to merge 1 commit into
apache:trunkfrom
Sejin-Hwang:deletiontask_leak
Closed

Sejin-Hwang wants to merge 1 commit into
apache:trunkfrom
Sejin-Hwang:deletiontask_leak

Conversation

@Sejin-Hwang

@Sejin-Hwang Sejin-Hwang commented Feb 22, 2023 •

Copy link
Copy Markdown

Description of PR

When the DockerContainerDeletionTask is completed, it should be deleted from the NodeManager's statestore, just like the FileDeletionTask.

JIRA : https://issues.apache.org/jira/browse/HADOOP-18639

How was this patch tested?

  • Unit test added
  • Deployed it on our own cluster and tested it to make sure it works.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 53s 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.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 19s trunk passed
+1 💚 compile 1m 31s trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 compile 1m 27s trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 checkstyle 0m 37s trunk passed
+1 💚 mvnsite 0m 45s trunk passed
+1 💚 javadoc 0m 45s trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javadoc 0m 32s trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 spotbugs 1m 34s trunk passed
+1 💚 shadedclient 26m 52s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 44s the patch passed
+1 💚 compile 1m 25s the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javac 1m 25s the patch passed
+1 💚 compile 1m 19s the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 javac 1m 19s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 23s /results-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager: The patch generated 2 new + 7 unchanged - 0 fixed = 9 total (was 7)
+1 💚 mvnsite 0m 37s the patch passed
+1 💚 javadoc 0m 30s the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javadoc 0m 26s the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 spotbugs 1m 35s the patch passed
+1 💚 shadedclient 27m 7s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 23m 31s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
139m 32s
Subsystem Report/Notes
Docker ClientAPI=1.42 ServerAPI=1.42 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5425/1/artifact/out/Dockerfile
GITHUB PR #5425
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 71ed66f96066 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / ab08810
Default Java Private Build-1.8.0_352-8u352-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5425/1/testReport/
Max. process+thread count 606 (vs. ulimit of 5500)
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-5425/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

…manager's statestore when the task is completed.
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 49s 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 appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 32s trunk passed
+1 💚 compile 1m 30s trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 compile 1m 24s trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 checkstyle 0m 36s trunk passed
+1 💚 mvnsite 0m 46s trunk passed
+1 💚 javadoc 0m 44s trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javadoc 0m 33s trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 spotbugs 1m 35s trunk passed
+1 💚 shadedclient 26m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 42s the patch passed
+1 💚 compile 1m 24s the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javac 1m 24s the patch passed
+1 💚 compile 1m 17s the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 javac 1m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 23s the patch passed
+1 💚 mvnsite 0m 37s the patch passed
+1 💚 javadoc 0m 30s the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04
+1 💚 javadoc 0m 27s the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08
+1 💚 spotbugs 1m 30s the patch passed
+1 💚 shadedclient 26m 55s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 23m 30s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 asflicense 0m 33s The patch does not generate ASF License warnings.
139m 13s
Subsystem Report/Notes
Docker ClientAPI=1.42 ServerAPI=1.42 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5425/2/artifact/out/Dockerfile
GITHUB PR #5425
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 4cd6557679cc 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b9662f3
Default Java Private Build-1.8.0_352-8u352-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5425/2/testReport/
Max. process+thread count 536 (vs. ulimit of 5500)
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-5425/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@github-actions

Copy link
Copy Markdown
Contributor

We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you feel like this was a mistake, or you would like to continue working on it, please feel free to re-open it and ask for a committer to remove the stale tag and review again.
Thanks all for your contribution.

@github-actions github-actions Bot added the Stale label Oct 25, 2025
@github-actions github-actions Bot closed this Oct 26, 2025
Willymontaz added a commit to criteo-forks/hadoop that referenced this pull request Jul 31, 2026
…from state store on completion (#102)

DockerContainerDeletionTask.run() never called deletionTaskFinished(), which
is the only thing in the NodeManager that calls
NMStateStoreService.removeDeletionTask(). Unlike FileDeletionTask, which
finishes its task at the end of run(), every Docker container removal
therefore left a permanent row in the LevelDB state store.

DeletionService.recover() reloads and re-schedules those rows on every start,
from inside serviceInit -- i.e. before the NM accepts new work -- so the
backlog grows without bound across the node's lifetime and genuine deletions
queue behind it. Observed in production as ~823k DockerContainerDeletionTask
instances queued in the DeletionService executor, reappearing in full after
every restart, while appcache cleanup starved behind them.

Replaying a stale removal is also pure waste: the container is long gone, but
LinuxContainerExecutor.removeDockerContainer still forks a privileged
container-executor to run docker inspect before deciding it is not removable.

Call deletionTaskFinished() from a finally block so the row is removed even if
the removal throws, and guard the unchecked LinuxContainerExecutor cast, which
would otherwise throw ClassCastException in the executor thread on a node
reconfigured to DefaultContainerExecutor with Docker tasks still in the store.

No migration is needed: the existing backlog loads one final time, each task
executes and removes itself, and the store converges to empty.

Reported upstream twice and still unfixed: YARN-11835 (PR apache#8405, open,
unreviewed) and HADOOP-18639 (PR apache#5425, auto-closed as stale). Both upstream
patches are a bare one-line deletionTaskFinished() outside any try/finally.

Co-authored-by: William Montaz <w.montaz@criteo.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants