mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [1/2] mesos git commit: Fixed a bug in 'ComposingContainerizerProcess::wait()'.
Date Tue, 30 May 2017 21:05:26 GMT
Repository: mesos
Updated Branches:
  refs/heads/1.2.x 127c16ff5 -> 96604ddf2


Fixed a bug in 'ComposingContainerizerProcess::wait()'.

Fixed a bug in the Composing Containerizer that would make it always
immediately return 'None' when trying to wait on a nested container
that had already been terminated and whose exit status was checkpointed.

Review: https://reviews.apache.org/r/59537/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0f3f41ef
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0f3f41ef
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0f3f41ef

Branch: refs/heads/1.2.x
Commit: 0f3f41ef0f5a814c51e89597ddd230c0e64d8c35
Parents: 127c16f
Author: Gastón Kleiman <gaston@mesosphere.io>
Authored: Tue May 30 13:50:06 2017 -0700
Committer: Jie Yu <yujie.jay@gmail.com>
Committed: Tue May 30 13:52:07 2017 -0700

----------------------------------------------------------------------
 src/slave/containerizer/composing.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0f3f41ef/src/slave/containerizer/composing.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp
index 46539e4..c48d166 100644
--- a/src/slave/containerizer/composing.cpp
+++ b/src/slave/containerizer/composing.cpp
@@ -612,11 +612,19 @@ Future<ContainerStatus> ComposingContainerizerProcess::status(
 Future<Option<ContainerTermination>> ComposingContainerizerProcess::wait(
     const ContainerID& containerId)
 {
-  if (!containers_.contains(containerId)) {
+  // A nested container might have already been terminated, therefore
+  // `containers_` might not contain it, but its exit status might have
+  // been checkpointed.
+  //
+  // The containerizer that launched the root container should be able
+  // to retrieve the exit status even if it has been checkpointed.
+  const ContainerID rootContainerId = protobuf::getRootContainerId(containerId);
+
+  if (!containers_.contains(rootContainerId)) {
     return None();
   }
 
-  return containers_[containerId]->containerizer->wait(containerId);
+  return containers_[rootContainerId]->containerizer->wait(containerId);
 }
 
 


Mime
View raw message