Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-8656

container-executor should not write cgroup tasks files for docker containers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0, 3.1.2
    • Component/s: None
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      If cgroups are enabled, we pass the --cgroup-parent option to docker run to ensure that all processes for the container are placed into a cgroup under (for example) /sys/fs/cgroup/cpu/cgroups.hierarchy/container_id. Docker creates a cgroup there with the docker container id as the name and all of the processes in the container go into that cgroup.

      container-executor has code in launch_docker_container_as_user() that then cherry-picks the PID of the docker container (usually the launch shell) and writes that into the /sys/fs/cgroup/cpu/cgroups.hierarchy/container_id/tasks file, effectively moving it from /sys/fs/cgroup/cpu/cgroups.hierarchy/container_id/docker_container_id to /sys/fs/cgroup/cpu/cgroups.hierarchy/container_id.  So you end up with one process out of the container in the container_id cgroup, and the rest in the container_id/docker_container_id cgroup.

      Since we are passing the --cgroup-parent to docker, there is no need to manually write the container pid to the tasks file - we can just remove the code that does this in the docker case.

        Attachments

        1. YARN-8656.002.patch
          10 kB
          Jim Brennan
        2. YARN-8656.001.patch
          1 kB
          Jim Brennan

          Activity

            People

            • Assignee:
              Jim_Brennan Jim Brennan
              Reporter:
              Jim_Brennan Jim Brennan
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: