[ 
https://issues.apache.org/jira/browse/FLINK-8836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16444174#comment-16444174
 ] 

ASF GitHub Bot commented on FLINK-8836:
---------------------------------------

Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5880#discussion_r182777472
  
    --- Diff: 
flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializerConcurrencyTest.java
 ---
    @@ -24,21 +24,71 @@
     import org.apache.flink.core.testutils.BlockerSync;
     import org.apache.flink.core.testutils.CheckedThread;
     
    +import com.esotericsoftware.kryo.Kryo;
    +import com.esotericsoftware.kryo.Serializer;
    +import com.esotericsoftware.kryo.io.Input;
    +import com.esotericsoftware.kryo.io.Output;
    +import org.junit.Assert;
     import org.junit.Test;
     
     import java.io.IOException;
    +import java.io.Serializable;
     
     import static org.junit.Assert.fail;
     
     /**
      * This tests that the {@link KryoSerializer} properly fails when accessed 
by two threads
    - * concurrently.
    + * concurrently and that Kryo serializers are properly duplicated to use 
them in different threads.
      *
      * <p><b>Important:</b> This test only works if assertions are activated 
(-ea) on the JVM
      * when running tests.
      */
     public class KryoSerializerConcurrencyTest {
     
    +   @Test
    +   public void testDuplicateSerializerWithDefaultSerializerClass() {
    --- End diff --
    
    test names are mixed up, this and the next one should be switched


> 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
>            Assignee: Stefan Richter
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> 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)

Reply via email to