Skip to content

containerdexecutor: clean up task if Start() fails - #3253

Merged
tonistiigi merged 1 commit into
moby:masterfrom
corhere:c8dexecutor-task-delete
Nov 3, 2022
Merged

containerdexecutor: clean up task if Start() fails#3253
tonistiigi merged 1 commit into
moby:masterfrom
corhere:c8dexecutor-task-delete

Conversation

@corhere

@corhere corhere commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

Deleting a containerd task whose status is Created fails with a "precondition failed" error. This is because (aside from Windows) a process is spawned when the task is created, and deleting the task while the process is running would leak the process if it was allowed. Change the deferred task.Delete call to pass the WithProcessKill delete option so the cleanup has a chance to succeed in the event that the p.Start call inside runProcess returns an error.

Signed-off-by: Cory Snider csnider@mirantis.com

Deleting a containerd task whose status is Created fails with a
"precondition failed" error. This is because (aside from Windows) a
process is spawned when the task is created, and deleting the task while
the process is running would leak the process if it was allowed.
Change the deferred `task.Delete` call to pass the `WithProcessKill`
delete option so the cleanup has a chance to succeed in the event that
the `p.Start` call inside `runProcess` returns an error.

Signed-off-by: Cory Snider <csnider@mirantis.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants