This is an automated email from the ASF dual-hosted git repository. alexr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 5fbfb8da5ad62c40752fa7b7e0a0842c892f6857 Author: Andrei Budnik <[email protected]> AuthorDate: Tue Aug 28 16:47:04 2018 +0200 Cleaned up container on launch failures in composing containerizer. Previously, if a parent container was unknown to the composing containerizer during an attempt to launch a nested container via `ComposingContainerizerProcess::launch()`, the composing containerizer returned an error without cleaning up the container. The `containerizer` field was uninitialized, so a further attempt to remove or destroy the nested container led to segfault. This patch removes the container when the parent container is unknown. Review: https://reviews.apache.org/r/68235/ --- src/slave/containerizer/composing.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp index 5216458..d854794 100644 --- a/src/slave/containerizer/composing.cpp +++ b/src/slave/containerizer/composing.cpp @@ -445,6 +445,11 @@ Future<Containerizer::LaunchResult> ComposingContainerizerProcess::launch( if (containerId.has_parent()) { ContainerID rootContainerId = protobuf::getRootContainerId(containerId); if (!containers_.contains(rootContainerId)) { + // We do cleanup here, otherwise we cannot remove or destroy the nested + // container due to its undefined `containerizer` field. + containers_.erase(containerId); + delete container; + return Failure( "Root container " + stringify(rootContainerId) + " not found"); }
