[jira] [Created] (FLINK-11274) Scala 2.12 Kryo serialization bug

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-11274) Scala 2.12 Kryo serialization bug

Shang Yuanchun (Jira)
Zhenhao Li created FLINK-11274:
----------------------------------

             Summary: Scala 2.12 Kryo serialization bug
                 Key: FLINK-11274
                 URL: https://issues.apache.org/jira/browse/FLINK-11274
             Project: Flink
          Issue Type: Bug
    Affects Versions: 1.7.1
         Environment: Flink 1.7.1

Scala 2.12.8
            Reporter: Zhenhao Li


The following code works well for serializing Scala classes, e.g., SortedSet[T], without problem in 1.7.0.

```
env.getConfig.registerTypeWithKryoSerializer(
      classOf[ClosureSerializer.Closure],
      classOf[ClosureSerializer]
    )
```

However, in 1.7.1 the following error occurs when checkpointing.
```
Serialization trace:
cmp$2 (scala.math.Ordering$$anon$6)
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:138)
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:115)
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:641)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:99)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528)
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:761)
        at com.twitter.chill.SortedSetSerializer.read(SortedSetSerializer.scala:38)
        at com.twitter.chill.SortedSetSerializer.read(SortedSetSerializer.scala:21)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:657)
        at org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer.copy(KryoSerializer.java:231)
        at org.apache.flink.api.scala.typeutils.CaseClassSerializer.copy(CaseClassSerializer.scala:101)
        at org.apache.flink.api.scala.typeutils.CaseClassSerializer.copy(CaseClassSerializer.scala:32)
        at org.apache.flink.runtime.state.heap.CopyOnWriteStateTable.get(CopyOnWriteStateTable.java:287)
        at org.apache.flink.runtime.state.heap.CopyOnWriteStateTable.get(CopyOnWriteStateTable.java:311)
        at org.apache.flink.runtime.state.heap.HeapValueState.value(HeapValueState.java:73)
        at org.apache.flink.streaming.api.scala.function.StatefulFunction.applyWithState(StatefulFunction.scala:41)
        at org.apache.flink.streaming.api.scala.function.StatefulFunction.applyWithState$(StatefulFunction.scala:40)
        at org.apache.flink.streaming.api.scala.KeyedStream$$anon$3.applyWithState(KeyedStream.scala:591)
        at org.apache.flink.streaming.api.scala.KeyedStream$$anon$3.flatMap(KeyedStream.scala:596)
        at org.apache.flink.streaming.api.operators.StreamFlatMap.processElement(StreamFlatMap.java:50)
        at org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInput(StreamInputProcessor.java:202)
        at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneInputStreamTask.java:105)
        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:704)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: io.connecterra.stateful.AggregationSlidingWindowStateUpdater$$$Lambda$506/497325684
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:136)
        ... 24 common frames omitted
```




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)