davidradl commented on code in PR #26461:
URL: https://github.com/apache/flink/pull/26461#discussion_r2044221366


##########
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java:
##########
@@ -426,11 +431,7 @@ public T deserialize(DataInputView source) throws 
IOException {
 
         if ((flags & IS_SUBCLASS) != 0) {
             String subclassName = source.readUTF();
-            try {
-                actualSubclass = Class.forName(subclassName, true, cl);
-            } catch (ClassNotFoundException e) {
-                throw new RuntimeException("Cannot instantiate class.", e);
-            }
+            actualSubclass = getSubclassByName(subclassName);

Review Comment:
   3 thoughts arounds this:
   - could there by a possibility that this method is driven such that 
different class loaders would be used to load the subclass? If so maybe it is 
safer to not cache or consider caching per classloader.
   - I guess for a long running job, with lots of pojos and subclasses , the 
cache just grows, could this become an issue?
   - I think we should have a unit test for this cache. 
    



-- 
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