Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15372

Race conditions and possible leaks in the Shell class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.10.0, 3.2.0
    • None
    • None
    • None

    Description

      YARN-5641 introduced some cleanup code in the Shell class. It has a race condition. Shell.runCommand() can be called while/after Shell.getAllShells() returned all the shells to be cleaned up. This new thread can avoid the clean up, so that the process held by it can be leaked causing leaked localized files/etc.

      I see another issue as well. Shell.runCommand() has a finally block with a process.destroy(); to clean up. However, the try catch block does not cover all instructions after the process is started, so for example we can exit the thread and leak the process, if timeOutTimer.schedule(timeoutTimerTask, timeOutInterval); causes an exception.

      Attachments

        1. HADOOP-15372.001.patch
          8 kB
          Eric Badger

        Issue Links

          Activity

            People

              ebadger Eric Badger
              miklos.szegedi@cloudera.com Miklos Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: