sujay-jain commented on code in PR #24205:
URL: https://github.com/apache/flink/pull/24205#discussion_r1947967477
##########
flink-core/src/main/java/org/apache/flink/api/java/ClosureCleaner.java:
##########
@@ -66,14 +67,20 @@ public class ClosureCleaner {
*/
public static void clean(
Object func, ExecutionConfig.ClosureCleanerLevel level, boolean
checkSerializable) {
- clean(func, level, checkSerializable, Collections.newSetFromMap(new
IdentityHashMap<>()));
+ clean(
+ func,
+ level,
+ checkSerializable,
+ Collections.newSetFromMap(new IdentityHashMap<>()),
+ new Stack<>());
}
private static void clean(
Object func,
ExecutionConfig.ClosureCleanerLevel level,
boolean checkSerializable,
- Set<Object> visited) {
+ Set<Object> visited,
+ Stack<Class<?>> clsReferences) {
Review Comment:
Do you see any risk of excessive stack growth in case of complex or deep
reference graphs?
##########
flink-core/src/test/java/org/apache/flink/api/java/ClosureCleanerTest.java:
##########
@@ -133,6 +135,27 @@ void testComplexTopLevelClassClean() throws Exception {
assertThat(result).isEqualTo(5);
}
+ @Test
+ public void testCleanNonSerializableNestedMap() throws Exception {
Review Comment:
Thanks for adding this test. Could you please add another test covering a
scenario where multiple reference classes are involved?
--
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]