azagrebin commented on a change in pull request #13355:
URL: https://github.com/apache/flink/pull/13355#discussion_r488442664



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/chaining/ChainedDriver.java
##########
@@ -64,12 +64,12 @@
 
        
        public void setup(TaskConfig config, String taskName, Collector<OT> 
outputCollector,
-                                         AbstractInvokable parent, 
UserCodeClassLoader userCodeClassLoader, ExecutionConfig executionConfig,
-                                         Map<String, Accumulator<?,?>> 
accumulatorMap)
+                       AbstractInvokable parent, UserCodeClassLoader 
userCodeClassLoader, ExecutionConfig executionConfig,

Review comment:
       `UserCodeClassLoader userCodeClassLoader` -> `ClassLoader 
userCodeClassLoader`
   also its callers like `BatchTask::initOutputs` and so on up the call stack 
(`DataSourceTask::initOutputs`)

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManager.java
##########
@@ -425,11 +424,21 @@ private void 
verifyClassLoader(Collection<PermanentBlobKey> requiredLibraries, C
                 * and the cached libraries are deleted immediately.
                 */
                private void releaseClassLoader() {
+                       runReleaseHooks();
+
+                       try {
+                               classLoader.close();
+                       } catch (IOException e) {
+                               LOG.warn("Failed to release user code class 
loader for " + Arrays.toString(libraries.toArray()));
+                       }
+               }
+
+               private void runReleaseHooks() {
                        Set<Map.Entry<String, Runnable>> hooks = 
releaseHooks.entrySet();
                        if (!hooks.isEmpty()) {
-                               LOG.debug("Running {} class loader shutdown 
hook(s): {}.", hooks.size(), releaseHooks.keySet());
                                for (Map.Entry<String, Runnable> hookEntry : 
hooks) {
                                        try {
+                                               LOG.debug("Running class loader 
shutdown hook: {}.", hookEntry.getKey());
                                                hookEntry.getValue().run();
                                        } catch (Throwable t) {
                                                LOG.debug("Failed to run 
release hook '{}' for user code class loader.", hookEntry.getValue(), t);

Review comment:
       do you think `debug` is enough to report this problem?
   I would use `warn`.




----------------------------------------------------------------
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:
[email protected]


Reply via email to