You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/01/03 09:08:38 UTC

mesos git commit: Made sure continuations using actor state are executed in actor context.

Repository: mesos
Updated Branches:
  refs/heads/master 23d5ac1da -> b4db23788


Made sure continuations using actor state are executed in actor context.

In `e273efe6976434858edb85bbcf367a02e963a467` we introduced layer
checkpointing to the provisioner, but did not make sure that
continutations making use of internal state of the provisioner actor
installed on futures where always executed in the actor's context.
This was problematic as continuations could be executed while actor
state was changing (data races), or after the the actor had terminated
(use after free).

In this patch we instead defer execution of continutions to the actor
owning the data.

This issue was identified with the clang-tidy `mesos-this-capture`
check.

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


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

Branch: refs/heads/master
Commit: b4db23788a91fbd1f832e5033c3c0e82911a96d9
Parents: 23d5ac1
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Tue Jan 2 17:50:44 2018 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Wed Jan 3 09:26:07 2018 +0100

----------------------------------------------------------------------
 src/slave/containerizer/mesos/provisioner/provisioner.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b4db2378/src/slave/containerizer/mesos/provisioner/provisioner.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/provisioner.cpp b/src/slave/containerizer/mesos/provisioner/provisioner.cpp
index 61e7718..7621c49 100644
--- a/src/slave/containerizer/mesos/provisioner/provisioner.cpp
+++ b/src/slave/containerizer/mesos/provisioner/provisioner.cpp
@@ -565,7 +565,7 @@ Future<ProvisionInfo> ProvisionerProcess::_provision(
       imageInfo.layers,
       rootfs,
       backendDir)
-    .then([=]() -> Future<ProvisionInfo> {
+    .then(defer(self(), [=]() -> Future<ProvisionInfo> {
       const string path =
         provisioner::paths::getLayersFilePath(rootDir, containerId);
 
@@ -584,7 +584,7 @@ Future<ProvisionInfo> ProvisionerProcess::_provision(
 
       return ProvisionInfo{
           rootfs, imageInfo.dockerManifest, imageInfo.appcManifest};
-    });
+    }));
 }