[ 
https://issues.apache.org/jira/browse/FLINK-25969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488188#comment-17488188
 ] 

Francesco Guardiani commented on FLINK-25969:
---------------------------------------------

I think here we need to investigate which classloader has to be used depending 
on the input of the various compile methods.

In case we're generating a class that is using only classes/class references 
from built in runtime packages, that is {{table-common}}, {{table-api-java}}, 
{{table-runtime}} but not table-planner, then I think it's fine to cache the 
way we do it, we just need to make sure we always use just the "flink table 
runtime" classloader, that is the classloader that loads any class from 
table-runtime. In case the generated class is referring to a user class, then 
perhaps we should not cache such class at all. But then I wonder, why a 
generated class should refer to a user class? Are there any cases where we are 
really forced into that, rather than just using interfaces of some kind?

One related question: is this "table runtime classloader" I described above 
always the same across multiple flink jobs?

Same applies to the expression cache.

> org.apache.flink.table.runtime.generated.CompileUtils might cause class leaks
> -----------------------------------------------------------------------------
>
>                 Key: FLINK-25969
>                 URL: https://issues.apache.org/jira/browse/FLINK-25969
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / Runtime
>    Affects Versions: 1.15.0
>            Reporter: Yun Gao
>            Priority: Major
>
> CompileUtils has two static caches, namely COMPILED_CACHE and 
> COMPILED_EXPRESSION_CACHE. COMPILED_CACHE is check that it might cache the 
> user ClassLoaders with strong references, thus it might need be improved. 
> COMPILED_EXPRESSION_CACHE would need a double check.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to