dawidwys commented on a change in pull request #18616:
URL: https://github.com/apache/flink/pull/18616#discussion_r798546630
##########
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:
BTW, the fields are not the same in both ctors. In the "old" ctor, we
create
```
LinkedHashMap<Class<?>, Integer> registeredClasses,
TypeSerializer<?>[] registeredSerializers,
Map<Class<?>, TypeSerializer<?>> subclassSerializerCache,
```
from the `ExecutionConfig` instead of retrieving them from the snapshot.
--
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]