Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-8836

Duplicating a KryoSerializer does not duplicate registered default serializers

    Details

      Description

      The duplicate() method of the KryoSerializer is as following:

      public KryoSerializer<T> duplicate() {
          return new KryoSerializer<>(this);
      }
      
      protected KryoSerializer(KryoSerializer<T> toCopy) {
          defaultSerializers = toCopy.defaultSerializers;
          defaultSerializerClasses = toCopy.defaultSerializerClasses;
      
          kryoRegistrations = toCopy.kryoRegistrations;
      
          ...
      }
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                srichter Stefan Richter
                Reporter:
                tzulitai Tzu-Li (Gordon) Tai
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: