guoweiM commented on a change in pull request #10152: [FLINK-14466][runtime] 
Let YarnJobClusterEntrypoint use user code class loader
URL: https://github.com/apache/flink/pull/10152#discussion_r345868426
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/entrypoint/YarnJobClusterEntrypoint.java
 ##########
 @@ -61,10 +64,14 @@ protected String getRPCPortRange(Configuration 
configuration) {
        }
 
        @Override
-       protected DefaultDispatcherResourceManagerComponentFactory 
createDispatcherResourceManagerComponentFactory(Configuration configuration) {
+       protected DefaultDispatcherResourceManagerComponentFactory 
createDispatcherResourceManagerComponentFactory(Configuration configuration) 
throws IOException {
+               final YarnConfigOptions.UserJarInclusion userJarInclusion = 
configuration
+                       .getEnum(YarnConfigOptions.UserJarInclusion.class, 
YarnConfigOptions.CLASSPATH_INCLUDE_USER_JAR);
+               final File usrLibDir =
+                       userJarInclusion == 
YarnConfigOptions.UserJarInclusion.DISABLED ? tryFindUserLibDirectory().get() : 
null;
                return 
DefaultDispatcherResourceManagerComponentFactory.createJobComponentFactory(
                        YarnResourceManagerFactory.getInstance(),
-                       FileJobGraphRetriever.createFrom(configuration));
+                       FileJobGraphRetriever.createFrom(configuration, 
usrLibDir));
 
 Review comment:
   If the user does not set the `CLASSPATH_INCLUDE_USER_JAR` to the `DISABLE` 
this would lead to add the usrlib directory to the user classpath. I think 
these jars in the usrlib should not add to the user classpath in this situation.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to