[ https://issues.apache.org/jira/browse/FLINK-6025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906556#comment-15906556 ]
ASF GitHub Bot commented on FLINK-6025: --------------------------------------- GitHub user tzulitai opened a pull request: https://github.com/apache/flink/pull/3518 [backport-1.2] [FLINK-6025] [core] Add Flink's own JavaSerializer for Kryo serialization This is a backport of #3517 for `release-1.2`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tzulitai/flink FLINK-6025-1.2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3518.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3518 ---- commit 888940847254b48252bc1587944d8c0f6089447f Author: Tzu-Li (Gordon) Tai <tzuli...@apache.org> Date: 2017-03-12T14:46:27Z [FLINK-6025] [core] Add Flink's own JavaSerializer for Kryo serialization This commit adds a reimplemented JavaSerializer to be registered with Kryo. This is due to a know issue with Kryo's JavaSerializer that may use the wrong classloader for deserialzation. Instead of registering Kryo's JavaSerializer for Throwables, it is now changed to register the reimplemented JavaSerializer. Users who bump into ClassNotFoundExceptions if they are using Kryo's JavaSerializer for their own types are also recommended to change to Flink's JavaSerializer. ---- > User code ClassLoader not used when KryoSerializer fallbacks to serialization > for copying > ----------------------------------------------------------------------------------------- > > Key: FLINK-6025 > URL: https://issues.apache.org/jira/browse/FLINK-6025 > Project: Flink > Issue Type: Bug > Components: Type Serialization System > Reporter: Tzu-Li (Gordon) Tai > Assignee: Tzu-Li (Gordon) Tai > > Reported in ML: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/AWS-exception-serialization-problem-td12063.html > This is caused by a known Kryo issue with its {{JavaSerializer}}: > https://github.com/EsotericSoftware/kryo/pull/483. > It happens when a {{Throwable}} is to be copied by the {{KryoSerialzer}}. > Since we use the {{JavaSerializer}} for throwables, and {{JavaSerializer}} > doesn't support copying, the {{KryoSerializer}} fallbacks to use > de-/serialization for the throwable. The problem is that on deserialization, > the classloader that the {{ObjectInputStream}} uses may be overriden, and > doesn't specifically uses Kryo's configured classloader (i.e., the user code > class loader), and results in {{ClassNotFoundException}}. > Generally, this may happen if the user also registers to use the > {{JavaSerializer}} for their types. > To fix the problem for {{Throwable}} serializing in the {{KryoSerializer}}, > we could either consider registering our own fixed {{JavaSerializer}} for > throwables, or wait for the Kryo fix to be released (to be fixed in Kryo > 4.0.1 release). -- This message was sent by Atlassian JIRA (v6.3.15#6346)