Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22519

Remove unnecessary stagingDirPath null check in ApplicationMaster.cleanupStagingDir()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: YARN
    • Labels:
      None

      Description

      In the below, the condition checks whether the stagingDirPath is null but stagingDirPath never becomes null. If SPARK_YARN_STAGING_DIR env var is null then it throws NPE while creating the Path.

      ApplicationMaster.scala
              stagingDirPath = new Path(System.getenv("SPARK_YARN_STAGING_DIR"))
              if (stagingDirPath == null) {
                logError("Staging directory is null")
                return
              }
      

      Here we need to check whether the System.getenv("SPARK_YARN_STAGING_DIR") is null or not, not the stagingDirPath.

        Attachments

          Activity

            People

            • Assignee:
              devaraj.k Devaraj K
              Reporter:
              devaraj.k Devaraj K
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: