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

Exceptions thrown during SparkContext or SparkEnv construction might lead to resource leaks or corrupted global state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.2.0, 1.3.0
    • 1.4.0
    • Spark Core
    • None

    Description

      The SparkContext and SparkEnv constructors instantiate a bunch of objects that may need to be cleaned up after they're no longer needed. If an exception is thrown during SparkContext or SparkEnv construction (e.g. due to a bad configuration setting), then objects created earlier in the constructor may not be properly cleaned up.

      This is unlikely to cause problems for batch jobs submitted through spark-submit, since failure to construct SparkContext will probably cause the JVM to exit, but it is a potentially serious issue in interactive environments where a user might attempt to create SparkContext with some configuration, fail due to an error, and re-attempt the creation with new settings. In this case, resources from the previous creation attempt might not have been cleaned up and could lead to confusing errors (especially if the old, leaked resources share global state with the new SparkContext).

      Attachments

        Issue Links

          Activity

            People

              vanzin Marcelo Masiero Vanzin
              joshrosen Josh Rosen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: