spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Pastorelli <>
Subject Spark Streaming dealing with broken files without dying
Date Mon, 10 Aug 2015 14:14:52 GMT
Hey Sparkers,
I would like to use Spark Streaming in production to observe a directory
and process files that are put inside it. The problem is that some of those
files can be broken leading to a IOException from the input reader. This
should be fine for the framework I think: the exception should be caught by
Spark Streaming and logged somewhere and the file causing the problem
should be skipped. Instead, when the exception is thrown the job is aborted
with error and no other files are processed. Ideally I would like to have
my Spark Streaming job to run forever and if something is not readable, to
just log it but stay alive. How can I achieve this?

The stack of the errors that kill my job is similar to

15/08/09 23:42:27 ERROR o.a.s.e.Executor Exception in task 823.0 in
stage 0.0 (TID 823) unexpected end of stream
        at org.apache.hadoop.mapreduce.lib.input.CompressedSplitLineReader.fillBuffer(
        at org.apache.hadoop.util.LineReader.readDefaultLine(
        at org.apache.hadoop.util.LineReader.readLine(
        at org.apache.hadoop.mapreduce.lib.input.CompressedSplitLineReader.readLine(
        at org.apache.hadoop.mapreduce.lib.input.LineRecordReader.nextKeyValue(
        at org.apache.spark.rdd.NewHadoopRDD$$anon$1.hasNext(NewHadoopRDD.scala:143)
        at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:39)
        at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
        at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
        at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
        at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
        at org.apache.spark.util.collection.WritablePartitionedIterator$$anon$3.writeNext(WritablePartitionedPairCollection.scala:105)
        at org.apache.spark.util.collection.ExternalSorter.spillToPartitionFiles(ExternalSorter.scala:375)
        at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:208)
        at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:62)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:70)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.executor.Executor$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

Thank you,

View raw message