diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java old mode 100644 new mode 100755 index dce24908a51..fde6f73b351 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java @@ -717,9 +717,9 @@ public class DockerLinuxContainerRuntime extends OCIContainerRuntime { } runCommand.addMountLocation(src, dst, mode); } - long commaCount = environment.get(ENV_DOCKER_CONTAINER_MOUNTS).chars() - .filter(c -> c == ',').count(); - if (mountCount != commaCount + 1) { + long semicolonCount = environment.get(ENV_DOCKER_CONTAINER_MOUNTS).chars() + .filter(c -> c == ';').count(); + if (mountCount != semicolonCount + 1) { // this means the matcher skipped an improperly formatted mount throw new ContainerExecutionException( "Unable to parse some mounts in user supplied mount list: " diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/OCIContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/OCIContainerRuntime.java old mode 100644 new mode 100755 index 45105f7ad17..1c054be07cd --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/OCIContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/OCIContainerRuntime.java @@ -71,8 +71,8 @@ public abstract class OCIContainerRuntime implements LinuxContainerRuntime { private static final Pattern HOSTNAME_PATTERN = Pattern.compile( "^[a-zA-Z0-9][a-zA-Z0-9_.-]+$"); static final Pattern USER_MOUNT_PATTERN = Pattern.compile( - "(?<=^|,)([^:\\x00]+):([^:\\x00]+)" + - "(:(r[ow]|(r[ow][+])?(r?shared|r?slave|r?private)))?(?:,|$)"); + "(?<=^|;)([^:\\x00]+):([^:\\x00]+)" + + "(:(r[ow]|(r[ow][+])?(r?shared|r?slave|r?private)))?(?:;|$)"); static final Pattern TMPFS_MOUNT_PATTERN = Pattern.compile( "^/[^:\\x00]+$"); static final String PORTS_MAPPING_PATTERN = diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java old mode 100644 new mode 100755 index 8ab9df6321b..eaf638817da --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java @@ -1345,7 +1345,7 @@ public class TestDockerContainerRuntime { env.put( DockerLinuxContainerRuntime.ENV_DOCKER_CONTAINER_MOUNTS, - "test_dir/test_resource_file:test_mount1:ro," + + "test_dir/test_resource_file:test_mount1:ro;" + "test_dir/test_resource_file:test_mount2:ro"); runtime.launchContainer(builder.build()); @@ -1395,8 +1395,8 @@ public class TestDockerContainerRuntime { env.put( DockerLinuxContainerRuntime.ENV_DOCKER_CONTAINER_MOUNTS, - "/tmp/foo:/tmp/foo:ro,/tmp/bar:/tmp/bar:rw,/tmp/baz:/tmp/baz," + - "/a:/a:shared,/b:/b:ro+shared,/c:/c:rw+rshared,/d:/d:private"); + "/tmp/foo:/tmp/foo:ro;/tmp/bar:/tmp/bar:rw;/tmp/baz:/tmp/baz;" + + "/a:/a:shared;/b:/b:ro+shared;/c:/c:rw+rshared;/d:/d:private"); runtime.launchContainer(builder.build()); List dockerCommands = readDockerCommands(); @@ -1444,7 +1444,7 @@ public class TestDockerContainerRuntime { env.put( DockerLinuxContainerRuntime.ENV_DOCKER_CONTAINER_MOUNTS, - "/source:target:ro,/source:target:other,/source:target:rw"); + "/source:target:ro;/source:target:other;/source:target:rw"); try { runtime.launchContainer(builder.build());