Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1144

Spark runner fails to deserialize MicrobatchSource in cluster mode

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • 0.5.0
    • runner-spark
    • None

    Description

      When running in cluster mode (yarn), spark runner fails on deserialization of MicrobatchSource

      After changes made in BEAM-921 spark runner fails in cluster mode with the following:

      16/12/12 04:27:01 ERROR ApplicationMaster: User class threw exception: org.apache.beam.sdk.Pipeline$PipelineExecutionException: com.esotericsoftware.kryo.KryoException: Error during Java deserialization.
      org.apache.beam.sdk.Pipeline$PipelineExecutionException: com.esotericsoftware.kryo.KryoException: Error during Java deserialization.
      	at org.apache.beam.runners.spark.SparkPipelineResult.beamExceptionFrom(SparkPipelineResult.java:72)
      	at org.apache.beam.runners.spark.SparkPipelineResult.waitUntilFinish(SparkPipelineResult.java:115)
      	at org.apache.beam.runners.spark.SparkPipelineResult.waitUntilFinish(SparkPipelineResult.java:101)
      	at com.paypal.risk.platform.aleph.example.MapOnlyExample.main(MapOnlyExample.java:38)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:559)
      Caused by: com.esotericsoftware.kryo.KryoException: Error during Java deserialization.
      	at com.esotericsoftware.kryo.serializers.JavaSerializer.read(JavaSerializer.java:42)
      	at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:729)
      	at org.apache.spark.serializer.KryoDeserializationStream.readObject(KryoSerializer.scala:228)
      	at org.apache.spark.serializer.DeserializationStream.readKey(Serializer.scala:169)
      	at org.apache.spark.serializer.DeserializationStream$$anon$2.getNext(Serializer.scala:201)
      	at org.apache.spark.serializer.DeserializationStream$$anon$2.getNext(Serializer.scala:198)
      	at org.apache.spark.util.NextIterator.hasNext(NextIterator.scala:73)
      	at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
      	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
      	at org.apache.spark.util.CompletionIterator.hasNext(CompletionIterator.scala:32)
      	at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:39)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
      	at org.apache.spark.InterruptibleIterator.foreach(InterruptibleIterator.scala:28)
      	at org.apache.spark.streaming.rdd.MapWithStateRDDRecord$.updateRecordWithData(MapWithStateRDD.scala:55)
      	at org.apache.spark.streaming.rdd.MapWithStateRDD.compute(MapWithStateRDD.scala:155)
      	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
      	at org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:69)
      	at org.apache.spark.rdd.RDD.iterator(RDD.scala:275)
      	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
      	at org.apache.spark.rdd.RDD.iterator(RDD.scala:277)
      	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
      	at org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:69)
      	at org.apache.spark.rdd.RDD.iterator(RDD.scala:275)
      	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
      	at org.apache.spark.scheduler.Task.run(Task.scala:89)
      	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassNotFoundException: org.apache.beam.runners.spark.io.MicrobatchSource
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:348)
      	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626)
      	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
      	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
      	at com.esotericsoftware.kryo.serializers.JavaSerializer.read(JavaSerializer.java:40)
      	... 30 more
      

      This seems to be caused by ClassLoader issues in the executor.

      Reverting BEAM-921 dose not remedy the situation because the previous version, in turn fails to deserialize as well with:

      java.lang.UnsupportedOperationException
      	at com.google.common.collect.ImmutableCollection.add(ImmutableCollection.java:91)
      

      Attachments

        Activity

          People

            aviemzur Aviem Zur
            aviemzur Aviem Zur
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: