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

Xintong Song commented on FLINK-34402:
--------------------------------------

 > Returning to the change, do you have any concern about the replacement?

Replacing `ClassLoader.getSystemClassLoader()` with 
`Thread.currentThread().getContextClassLoader()` implies the assumption that 
`BlobLibraryCacheManager` should be called from a thread that is created by the 
system classloader, which is implicit and fragile. If later 
`BlobLibraryCacheManager` is called from another thread, the assumption can 
easily be overlooked and broken, leading to unpredictable behaviors. This may 
not be absolutely unaffordable, but compared to what we gain from the changes, 
I'd rather not to apply it.

>  Class loading conflicts when using PowerMock in ITcase.
> --------------------------------------------------------
>
>                 Key: FLINK-34402
>                 URL: https://issues.apache.org/jira/browse/FLINK-34402
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Coordination
>    Affects Versions: 1.19.0
>            Reporter: yisha zhou
>            Assignee: yisha zhou
>            Priority: Major
>
> Currently when no user jars exist, system classLoader will be used to load 
> classes as default. However, if we use powerMock to create some ITCases, the 
> framework will utilize JavassistMockClassLoader to load classes.  Forcing the 
> use of the system classLoader can lead to class loading conflict issue.
> Therefore we should use Thread.currentThread().getContextClassLoader() 
> instead of 
> ClassLoader.getSystemClassLoader() here.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to