YARN-11835: DockerContainerDeletionTask never calls deletionTaskFinished(), causing NM recovery store accumulation#8405
Open
Khrol wants to merge 1 commit intoapache:trunkfrom
Conversation
…hed(), causing NM recovery store accumulation. Contributed by Igor Khrol.
|
🎊 +1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
YARN-11835
Problem
DockerContainerDeletionTask.run()never callsdeletionTaskFinished(), so every Docker container deletion task written to the NM recovery store (RocksDB/LevelDB) accumulates indefinitely and is replayed on every NodeManager restart.FileDeletionTask.run()has always had this call; it was simply missing fromDockerContainerDeletionTask.Fix
Added the missing
deletionTaskFinished()call at the end ofDockerContainerDeletionTask.run():Note on error handling
The reviewer on a related patch asked whether we should wrap
removeDockerContainerin try/catch and setsetSuccess(false)on failure, mirroring the pattern inFileDeletionTask.run().FileDeletionTaskuses that pattern becausedeleteAsUserthrows checked exceptions (IOException | InterruptedException) that must be handled.removeDockerContainer, however, already catchesContainerExecutionExceptioninternally and never propagates any exception — adding a try/catch here would be dead code that can never trigger. The simpler form is therefore correct.Testing
Added
testRunCallsDeletionTaskFinished()toTestDockerContainerDeletionTask:removeDockerContainer(containerId)is called.stateStore.removeDeletionTask(taskId)is called — the observable effect ofdeletionTaskFinished()— confirming the task removes itself from the recovery store.Also tested on our production environment.