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

cgroup file leak in NM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.0, 3.1.1, 3.0.4, 2.10.1
    • nodemanager
    • None
    • Reviewed

    Description

      As Jiandan said in YARN-6562, NM may delete  Cgroup container file timeout with logs like below:

      org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler: Unable to delete cgroup at: /cgroup/cpu/hadoop-yarn/container_xxx, tried to delete for 1000ms

       

      we found one situation is that when we set yarn.nodemanager.sleep-delay-before-sigkill.ms bigger than yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms, the cgroup file leak happens . 

       

      One container process tree looks like follow graph:

      bash(16097)───java(16099)─┬─{java}(16100) 

                                                        ├─{java}(16101) 

                             ├─{java}(16102)

       

      when NM kills a container, NM sends kill -15 -pid to kill container process group. Bash process will exit when it received sigterm, but java process may do some job (shutdownHook etc.), and doesn't exit unit receive sigkill. And when bash process exits, CgroupsLCEResourcesHandler begin to try to delete cgroup files. So when yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms arrived, the java processes may still running and cgourp/tasks still not empty and cause a cgroup file leak.

       

      we add a condition that yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms must bigger than yarn.nodemanager.sleep-delay-before-sigkill.ms to solve this problem.

       

      Attachments

        1. YARN-8382-branch-2.8.3.002.patch
          2 kB
          Hu Ziqian
        2. YARN-8382.002.patch
          1 kB
          Hu Ziqian
        3. YARN-8382.001.patch
          3 kB
          Hu Ziqian
        4. YARN-8382-branch-2.8.3.001.patch
          3 kB
          Hu Ziqian

        Activity

          People

            ziqian hu Hu Ziqian
            ziqian hu Hu Ziqian
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: