[
https://issues.apache.org/jira/browse/FLINK-8836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383510#comment-16383510
]
Stephan Ewen commented on FLINK-8836:
-------------------------------------
Is the concern that the default serializers themselves are stateful?
As far as I understood it so far, the Kryo object is stateful and not thread
safe, hence needs to be exclusive to one thread at a time. Kryo does the
tracking of object graphs and generic scopes, which makes it not thread safe
during serialization / deserialization.
The serializers used by Kryo should be stateless and can thus sharable.
Please double check this assumption - if the serializers are actually stateful,
then we need to see how we can handle that.
If they are not, we should be able to close this issue.
> Duplicating a KryoSerializer does not duplicate registered default serializers
> ------------------------------------------------------------------------------
>
> Key: FLINK-8836
> URL: https://issues.apache.org/jira/browse/FLINK-8836
> Project: Flink
> Issue Type: Bug
> Components: Type Serialization System
> Reporter: Tzu-Li (Gordon) Tai
> Priority: Critical
>
> The {{duplicate()}} method of the {{KryoSerializer}} is as following:
> {code:java}
> public KryoSerializer<T> duplicate() {
> return new KryoSerializer<>(this);
> }
> protected KryoSerializer(KryoSerializer<T> toCopy) {
> defaultSerializers = toCopy.defaultSerializers;
> defaultSerializerClasses = toCopy.defaultSerializerClasses;
> kryoRegistrations = toCopy.kryoRegistrations;
> ...
> }
> {code}
> Shortly put, when duplicating a {{KryoSerializer}}, the
> {{defaultSerializers}} serializer instances are directly provided to the new
> {{KryoSerializer}} instance.
> This causes the fact that those default serializers are shared across two
> different {{KryoSerializer}} instances, and therefore not a correct duplicate.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)