zentol commented on a change in pull request #13027:
URL: https://github.com/apache/flink/pull/13027#discussion_r469080456



##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -124,6 +124,15 @@
                return parseParentFirstLoaderPatterns(base, append);
        }
 
+       @Documentation.Section(Documentation.Sections.EXPERT_CLASS_LOADING)
+       public static final ConfigOption<Boolean> CHECK_LEAKED_CLASSLOADER = 
ConfigOptions
+               .key("classloader.check_leaked_classloader")

Review comment:
       we don't use underscores.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoaders.java
##########
@@ -136,7 +150,10 @@ public void close() {
 
                private FlinkUserCodeClassLoader ensureInner() {
                        if (inner == null) {
-                               throw new IllegalStateException("Trying to 
access closed classloader");
+                               throw new IllegalStateException("Trying to 
access closed classloader. Please check if you store " +
+                                       "classloaders directly or indirectly in 
static fields. If the stacktrace suggests that the leak " +
+                                       "occurs in a third party library and 
cannot be fixed immediately, you can disable this check " +
+                                       "with the configuration 
'classloader.check_leaked_classloader'.");

Review comment:
       Retrieve the key from the actual configuration object instead.

##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -124,6 +124,15 @@
                return parseParentFirstLoaderPatterns(base, append);
        }
 
+       @Documentation.Section(Documentation.Sections.EXPERT_CLASS_LOADING)
+       public static final ConfigOption<Boolean> CHECK_LEAKED_CLASSLOADER = 
ConfigOptions
+               .key("classloader.check_leaked_classloader")
+               .booleanType()
+               .defaultValue(true)
+               .withDescription("Fails if a user classloader is used in 
another job after a job has been finished. This " +
+                       "check should only be disabled if the class leak occurs 
in an external library cannot be fixed " +
+                       "immediately.");

Review comment:
       ```
   Fails attempts at loading classes if the user classloader of a job is used 
after it has terminated.
   This is usually caused by the classloader being leaked by lingering threads 
or misbehaving libraries, which may also result in the classloader being used 
by other jobs.
   This check should only be disabled if such a leak prevents further jobs from 
running.
   ```




----------------------------------------------------------------
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


Reply via email to