You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2018/01/09 20:54:57 UTC
[2/2] mesos git commit: Fixed the persistent volume permission issue
in DockerContainerizer.
Fixed the persistent volume permission issue in DockerContainerizer.
This patch fixes MESOS-8356 by skipping the current container to be
launched when doing the shared volume check (`isVolumeInUse`). Prior to
this patch, the code is buggy because `isVolumeInUse` will always be set
to `true`.
Review: https://reviews.apache.org/r/65049
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f63ad48e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f63ad48e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f63ad48e
Branch: refs/heads/1.3.x
Commit: f63ad48eccbfe7879787bfdcb3eae6dd4643e20a
Parents: 721eeb2
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Jan 9 11:23:20 2018 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jan 9 12:54:46 2018 -0800
----------------------------------------------------------------------
src/slave/containerizer/docker.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f63ad48e/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 2480f59..58a85be 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -548,8 +548,15 @@ Try<Nothing> DockerContainerizerProcess::updatePersistentVolumes(
bool isVolumeInUse = false;
- foreachvalue (const Container* container, containers_) {
- if (container->resources.contains(resource)) {
+ foreachpair (const ContainerID& _containerId,
+ const Container* _container,
+ containers_) {
+ // Skip self.
+ if (_containerId == containerId) {
+ continue;
+ }
+
+ if (_container->resources.contains(resource)) {
isVolumeInUse = true;
break;
}