You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/25 07:30:53 UTC

[GitHub] [flink] JingsongLi commented on a change in pull request #10620: [FLINK-15239][table-planner-blink] CompileUtils::COMPILED_CACHE leaks class loaders

JingsongLi commented on a change in pull request #10620: [FLINK-15239][table-planner-blink] CompileUtils::COMPILED_CACHE leaks class loaders
URL: https://github.com/apache/flink/pull/10620#discussion_r361271907
 
 

 ##########
 File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java
 ##########
 @@ -45,7 +48,7 @@
 	 * number of Meta zone GC (class unloading), resulting in performance bottlenecks. So we add
 	 * a cache to avoid this problem.
 	 */
-	protected static final Cache<Tuple2<ClassLoader, String>, Class<?>> COMPILED_CACHE = CacheBuilder
+	protected static final Cache<String, Cache<ClassLoader, Class>> COMPILED_CACHE = CacheBuilder
 		.newBuilder()
 		.maximumSize(100)   // estimated cache size
 
 Review comment:
   1. For the execution mode of Flink, the `UserCodeClassLoader` used by each task may be different.
   2. The class from CodeGenerated may contain the dependence on user code class, which is in `UserCodeClassLoader` of a task.
   
   So, if we ignore class loader, that will lead to errors. Maybe class not found or class not match.
   
   I don't know the details of Spark and Calcite, but maybe Spark breaks # 2 and Calcite breaks # 1.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services