Repository: mesos Updated Branches: refs/heads/master 811c8bfd8 -> 2f92699e1
Temporary fix for the issue when making slave's work_dir a shared mount. Review: https://reviews.apache.org/r/38685 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2f92699e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2f92699e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2f92699e Branch: refs/heads/master Commit: 2f92699e1ba87054a515cf82b68dc3fa76dd8c27 Parents: fe17d94 Author: Jie Yu <[email protected]> Authored: Tue Sep 22 18:35:28 2015 -0700 Committer: Jie Yu <[email protected]> Committed: Wed Sep 23 13:02:42 2015 -0700 ---------------------------------------------------------------------- .../isolators/filesystem/linux.cpp | 33 +++++++------------- 1 file changed, 11 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/2f92699e/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 514b0e0..8fa929f 100644 --- a/src/slave/containerizer/isolators/filesystem/linux.cpp +++ b/src/slave/containerizer/isolators/filesystem/linux.cpp @@ -104,37 +104,26 @@ Try<Isolator*> LinuxFilesystemIsolatorProcess::create( // visible. It's OK to use the blocking os::shell here because // 'create' will only be invoked during initialization. Try<string> mount = os::shell( - "mount --bind %s %s", + "mount --bind %s %s && " + "mount --make-slave %s && " + "mount --make-shared %s", + flags.work_dir.c_str(), + flags.work_dir.c_str(), flags.work_dir.c_str(), flags.work_dir.c_str()); if (mount.isError()) { return Error( "Failed to self bind mount '" + flags.work_dir + - "': " + mount.error()); + "' and make it a shared mount: " + mount.error()); } } - // Mark the mount as a shared+slave mount. - Try<string> mount = os::shell( - "mount --make-slave %s", - flags.work_dir.c_str()); - - if (mount.isError()) { - return Error( - "Failed to mark '" + flags.work_dir + - "' as a slave mount: " + mount.error()); - } - - mount = os::shell( - "mount --make-shared %s", - flags.work_dir.c_str()); - - if (mount.isError()) { - return Error( - "Failed to mark '" + flags.work_dir + - "' as a shared mount: " + mount.error()); - } + // TODO(jieyu): Currently, we don't check if the slave's work_dir + // mount is a shared mount or not. We just assume it is. We cannot + // simply mark the slave as shared again because that will create a + // new peer group for the mounts. This is a temporary workaround for + // now while we are thinking about fixes. Owned<MesosIsolatorProcess> process( new LinuxFilesystemIsolatorProcess(flags, provisioner));
