Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/4554
  
    I took only a very brief look at this, but I am not totally sure whether 
the `ChildFirstClassLoader` implementation is actually correct. Even if it is, 
it seems to do redundant work, like looking at the URLs twice (in the 
`findClass(name);` call and the `super.loadClass(name, resolve);` call).
    
    We have a working version of a ChildFirstClassLoader here, why not use 
that? Is that implementation suboptimal?
    
https://github.com/apache/flink/blob/fa11845b926f8371e9cee47775ca0e48176b686e/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDbMultiClassLoaderTest.java#L78
    
    We should also never reference the System Classloader directly, it breaks 
all embedded setups or service architecture (OSGI) setups where you end up with 
hierarchical class loaders.
    
    My feeling is also that this does many changes that may not be necessary, 
like change the setup of the client, packaged program, etc. Passing the 
configuration through everything makes this change rather involved.
    
    I was wondering if it is not sufficient to simply let the TaskManager pass 
this as a flag to the library cache manager. Then you would not need to pass 
configs everywhere - the only ever config access is by the TaskManager or Task 
when it creates the classloader, and the config is available there anyways. 
    
    Concerning class loader setup on the client - not sure if we should change 
this in the same PR. This is probably much less critical (the main method does 
not instantiate many of the dependencies) and that part changes so heavily with 
flip-6 already. Various setups may not even have separate classloaders on the 
client anyways, but everything is in the app class loader there.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to