Khrol opened a new pull request, #8405:
URL: https://github.com/apache/hadoop/pull/8405
## YARN-11835
### Problem
`DockerContainerDeletionTask.run()` never calls `deletionTaskFinished()`, 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
from `DockerContainerDeletionTask`.
### Fix
Added the missing `deletionTaskFinished()` call at the end of
`DockerContainerDeletionTask.run()`:
```java
public void run() {
LinuxContainerExecutor exec = ((LinuxContainerExecutor)
getDeletionService().getContainerExecutor());
exec.removeDockerContainer(containerId);
deletionTaskFinished(); // was missing — tasks accumulated in recovery
store forever
}
```
### Note on error handling
The reviewer on a related patch asked whether we should wrap
`removeDockerContainer` in try/catch and set `setSuccess(false)` on failure,
mirroring the pattern in `FileDeletionTask.run()`.
`FileDeletionTask` uses that pattern because `deleteAsUser` throws checked
exceptions (`IOException | InterruptedException`) that must be handled.
`removeDockerContainer`, however, already catches `ContainerExecutionException`
internally 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()` to
`TestDockerContainerDeletionTask`:
- Verifies `removeDockerContainer(containerId)` is called.
- Verifies `stateStore.removeDeletionTask(taskId)` is called — the
observable effect of `deletionTaskFinished()` — confirming the task removes
itself from the recovery store.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]