Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/5950#discussion_r185994375
--- Diff:
flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSerializationUtil.java
---
@@ -200,7 +197,7 @@ public static void
writeSerializersAndConfigsWithResilience(
for (int i = 0; i < numSerializersAndConfigSnapshots;
i++) {
bufferWithPos.setPosition(offsets[i * 2]);
- serializer = tryReadSerializer(bufferWrapper,
userCodeClassLoader);
+ serializer = tryReadSerializer(bufferWrapper,
userCodeClassLoader, true);
--- End diff --
The reason why this method is so complex, is because it handles indexing of
the serializers' and serializer config snapshots' offsets within the byte
stream. It does so to be able to read all serializers and their serializer
config snapshots fault tolerantly, and to not leave the stream corrupt when
some exception occurs.
I'm not sure we can break this method up - doing so would just be moving a
lot of duplicate code to the callers (due to the fact that we previously have
the offset index reading / writing, if we remove that we still need to maintain
backwards compatibility).
---