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

Kryo cannot serialize results returned by asJavaIterable (and thus groupBy/cogroup are broken in Java APIs when Kryo is used)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1, 1.1.0
    • Spark Core
    • None

    Description

      The combination of Kryo serializer & Java API could lead to the following exception in groupBy/groupByKey/cogroup:

      org.apache.spark.SparkException: Job aborted due to stage failure: Exception while deserializing and fetching task: java.lang.UnsupportedOperationException
      org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1033)
      org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1017)
      org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1015)
      scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
      org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1015)
      org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:633)
      org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:633)
      scala.Option.foreach(Option.scala:236)
      org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:633)
      org.apache.spark.scheduler.DAGSchedulerEventProcessActor$$anonfun$receive$2.applyOrElse(DAGScheduler.scala:1207)
      akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
      akka.actor.ActorCell.invoke(ActorCell.scala:456)
      akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
      akka.dispatch.Mailbox.run(Mailbox.scala:219)
      akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
      scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
      scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
      scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
      scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)3:45 PM
      

      or

      14/06/24 16:38:09 ERROR TaskResultGetter: Exception while getting task result
      java.lang.UnsupportedOperationException
      at java.util.AbstractCollection.add(AbstractCollection.java:260)
      at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
      at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
      at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:729)
      at carbonite.serializer$mk_collection_reader$fn__50.invoke(serializer.clj:57)
      at clojure.lang.Var.invoke(Var.java:383)
      at carbonite.ClojureVecSerializer.read(ClojureVecSerializer.java:17)
      at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:729)
      at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:338)
      at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:293)
      at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:729)
      at org.apache.spark.serializer.KryoSerializerInstance.deserialize(KryoSerializer.scala:144)
      at org.apache.spark.scheduler.DirectTaskResult.value(TaskResult.scala:79)
      at org.apache.spark.scheduler.TaskSetManager.handleSuccessfulTask(TaskSetManager.scala:480)
      at org.apache.spark.scheduler.TaskSchedulerImpl.handleSuccessfulTask(TaskSchedulerImpl.scala:316)
      at org.apache.spark.scheduler.TaskResultGetter$$anon$2$$anonfun$run$1.apply$mcV$sp(TaskResultGetter.scala:68)
      at org.apache.spark.scheduler.TaskResultGetter$$anon$2$$anonfun$run$1.apply(TaskResultGetter.scala:47)
      at org.apache.spark.scheduler.TaskResultGetter$$anon$2$$anonfun$run$1.apply(TaskResultGetter.scala:47)
      at org.apache.spark.util.Utils$.logUncaughtExceptions(Utils.scala:1213)
      at org.apache.spark.scheduler.TaskResultGetter$$anon$2.run(TaskResultGetter.scala:46)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      

      Thanks sorenmacbeth for reporting this.

      Attachments

        Issue Links

          Activity

            People

              rxin Reynold Xin
              rxin Reynold Xin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: