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

StreamingContext should not allow start() to be called after calling stop()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.0.1, 1.0.2, 1.1.0
    • Fix Version/s: 1.0.3, 1.1.1, 1.2.0
    • Component/s: DStreams
    • Labels:
      None

      Description

      In Spark 1.0.0+, calling stop() on a StreamingContext that has not been started is a no-op which has no side-effects. This allows users to call stop() on a fresh StreamingContext followed by start(). I believe that this almost always indicates an error and is not behavior that we should support. Since we don't allow start() stop() start() then I don't think it makes sense to allow stop() start().

      The current behavior can lead to resource leaks when StreamingContext constructs its own SparkContext: if I call stop(stopSparkContext=True), then I expect StreamingContext's underlying SparkContext to be stopped irrespective of whether the StreamingContext has been started. This is useful when writing unit test fixtures.

      Prior discussions:

        Attachments

          Activity

            People

            • Assignee:
              joshrosen Josh Rosen
              Reporter:
              joshrosen Josh Rosen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: