Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/3121#issuecomment-61927353
@tdas It looks like a change that I made to `StreamingContext.stop()`
legitimately broke one of the tests:
```
[info] - stop before start and start after stop *** FAILED *** (1 second,
163 milliseconds)
[info] org.apache.spark.SparkException: StreamingContext has already been
stopped
```
Here's the test code:
```scala
test("stop before start and start after stop") {
ssc = new StreamingContext(master, appName, batchDuration)
addInputStream(ssc).register()
ssc.stop() // stop before start should not throw exception
ssc.start() // <---- This is the line that's throwing the exception
ssc.stop()
intercept[SparkException] {
ssc.start() // start after stop should throw exception
}
}
```
The issue is that the old code would let you call `ssc.stop()` on a
StreamingSparkContext that hadn't been started and would then let you call
`start()` on it. I don't like the old semantics, since calling `start()` after
`stop()` should _always_ be an error. Can I change this, or do I have to
retain the old and confusing semantics?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]