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

Provide actionable exception if Kryo buffer is not large enough

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.1, 1.4.0
    • Component/s: Spark Core
    • Labels:

      Description

      Right now if you don't have a large enough Kryo buffer, you get a really confusing exception. I noticed this when using Kryo to serialize broadcasted tables in Spark SQL. We should catch-then-rethrow this in the KryoSerializer, wrapping it in a message that suggests increasing the Kryo buffer size configuration variable.

      com.esotericsoftware.kryo.KryoException: Buffer overflow. Available: 0, required: 3
      Serialization trace:
      value (org.apache.spark.sql.catalyst.expressions.MutableAny)
      values (org.apache.spark.sql.catalyst.expressions.SpecificMutableRow)
      	at com.esotericsoftware.kryo.io.Output.require(Output.java:138)
      	at com.esotericsoftware.kryo.io.Output.writeAscii_slow(Output.java:446)
      	at com.esotericsoftware.kryo.io.Output.writeString(Output.java:306)
      	at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.write(DefaultSerializers.java:153)
      	at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.write(DefaultSerializers.java:146)
      	at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
      	at com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
      	at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
      	at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
      	at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.write(DefaultArraySerializers.java:318)
      	at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.write(DefaultArraySerializers.java:293)
      	at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501)
      	at com.esotericsoftware.kryo.serializers.FieldSerializer$ObjectField.write(FieldSerializer.java:564)
      	at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:213)
      	at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
      	at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.write(DefaultArraySerializers.java:318)
      	at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.write(DefaultArraySerializers.java:293)
      	at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:568)
      	at org.apache.spark.serializer.KryoSerializerInstance.serialize(KryoSerializer.scala:167)
      	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:234)
      	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:745)
      

      /cc Kay Ousterhout who helped report his issue

        Attachments

          Activity

            People

            • Assignee:
              levkhomich Lev Khomich
              Reporter:
              pwendell Patrick Wendell
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: