dawidwys commented on a change in pull request #18616:
URL: https://github.com/apache/flink/pull/18616#discussion_r798545141



##########
File path: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
##########
@@ -163,25 +164,42 @@ public boolean isImmutableType() {
 
     @Override
     public PojoSerializer<T> duplicate() {
+        TypeSerializer<Object>[] duplicateFieldSerializers = 
duplicateSerializers(fieldSerializers);
+        TypeSerializer<Object>[] duplicateRegisteredSerializers =
+                duplicateSerializers(registeredSerializers);
+
+        // we must create a new instance, otherwise the 
subclassSerializerCache can create
+        // concurrency problems
+        return new PojoSerializer<>(

Review comment:
       That's the issue that the other ctor is not used when recreating the 
serializer from the snapshot. The other ctor discards parts of the internal 
state that potentially comes from the snapshot. Therefore it cannot be used for 
duplication. It can be used though for creating a serializer for the first time.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to