由于阶段故障,Spark单元测试失败



我最近将一个应用程序从Spark 1.4.1升级到1.6.0,其中我的应用程序(在ScalaTest 3.0中)中的单元测试突然失败,这不是由于Spark的API或行为变化。

奇怪的是,每次我用sbt test运行测试时,都会有不同的测试失败,并且总是显示以下消息:

[info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task 87 in stage 206.0 failed 1 times, most recent failure: Lost task 87.0 in stage 206.0 (TID 4228, localhost): ExecutorLostFailure (executor driver exited caused by one of the running
 tasks) Reason: Executor heartbeat timed out after 148400 ms
[info] Driver stacktrace:
[info]   at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1431)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1419)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1418)
[info]   at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
[info]   at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
[info]   at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1418)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
[info]   at scala.Option.foreach(Option.scala:236)
[info]   at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:799)
[info]   ...

我在build.sbt中设置了如下内容:

javaOptions in test += "-Xmx2G"
fork in test := true
parallelExecution in test := false

所以,单元测试是好的,但有一些事情,我不能把我的手指。有人知道吗?

由于这段代码一直在工作,我怀疑默认内存设置(执行器或驱动程序或开销)可能随着升级而改变。

请为您的应用程序id发布纱线日志。它将有更多的错误细节。

同样,如果出现类似错误,请查看此链接https://community.cloudera.com/t5/Advanced-Analytics-Apache-Spark/Executor-Timed-Out/td-p/45097

最新更新