juanrh / sscheck

ScalaCheck for Spark
Apache License 2.0
63 stars 9 forks source link

Polish support for checkpointing #31

Closed juanrh closed 8 years ago

juanrh commented 9 years ago

That should include, at least:

15/09/23 16:59:21 WARN SharedStreamingContext: stopping test Spark Streaming context
15/09/23 16:59:21 ERROR CheckpointWriter: Could not submit checkpoint task to the thread pool executor
java.util.concurrent.RejectedExecutionException: Task org.apache.spark.streaming.CheckpointWriter$CheckpointWriteHandler@56e81962 rejected from java.util.concurrent.ThreadPoolExecutor@1fda9d81[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 61]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
    at org.apache.spark.streaming.CheckpointWriter.write(Checkpoint.scala:244)
    at org.apache.spark.streaming.scheduler.JobGenerator.doCheckpoint(JobGenerator.scala:291)
    at org.apache.spark.streaming.scheduler.JobGenerator.org$apache$spark$streaming$scheduler$JobGenerator$$processEvent(JobGenerator.scala:180)
    at org.apache.spark.streaming.scheduler.JobGenerator$$anon$1.onReceive(JobGenerator.scala:83)
    at org.apache.spark.streaming.scheduler.JobGenerator$$anon$1.onReceive(JobGenerator.scala:82)
    at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
15/09/23 16:59:21 WARN SharedSparkContext: stopping test Spark context

this doesn't break the tests but it is not nice. We could try first stopping gracefully and only then stopping directly, and also try our luck in the spark mailing list

juanrh commented 9 years ago

Consider using the following code to stop the streaming context in DStreamProp.forall when a counterexample is found

Try { 
            ssc.stop(stopSparkContext = false, stopGracefully = true) 
          } recover {
            case _ => ssc.stop(stopSparkContext=false, stopGracefully=false)
          }
juanrh commented 8 years ago

fixed in 0.2.1-SNAPSHOT when using the trait DStreamTLProperty and calling `forAllDStream