Fixed MESOS-3430 by making the sandbox/work directory mount as shared and slave.
Review: https://reviews.apache.org/r/38471 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5f4e1fad Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5f4e1fad Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5f4e1fad Branch: refs/heads/master Commit: 5f4e1fadc012a833674c7894975e23b3761633c5 Parents: cf7e926 Author: Jie Yu <[email protected]> Authored: Thu Sep 17 14:48:39 2015 -0700 Committer: Jie Yu <[email protected]> Committed: Thu Sep 17 15:19:15 2015 -0700 ---------------------------------------------------------------------- .../isolators/filesystem/linux.cpp | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/5f4e1fad/src/slave/containerizer/isolators/filesystem/linux.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/isolators/filesystem/linux.cpp b/src/slave/containerizer/isolators/filesystem/linux.cpp index 152acc3..f1e6f75 100644 --- a/src/slave/containerizer/isolators/filesystem/linux.cpp +++ b/src/slave/containerizer/isolators/filesystem/linux.cpp @@ -290,6 +290,19 @@ Future<Option<ContainerPrepareInfo>> LinuxFilesystemIsolatorProcess::__prepare( None(), directory, None(), + MS_SLAVE, + NULL); + + if (mount.isError()) { + return Failure( + "Failed to mark work directory '" + directory + + "' as a slave mount: " + mount.error()); + } + + mount = fs::mount( + None(), + directory, + None(), MS_SHARED, NULL); @@ -344,6 +357,19 @@ Future<Option<ContainerPrepareInfo>> LinuxFilesystemIsolatorProcess::__prepare( None(), sandbox, None(), + MS_SLAVE, + NULL); + + if (mount.isError()) { + return Failure( + "Failed to mark sandbox '" + sandbox + + "' as a slave mount: " + mount.error()); + } + + mount = fs::mount( + None(), + sandbox, + None(), MS_SHARED, NULL);
