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



##########
File path: 
flink-rpc/flink-rpc-akka/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
##########
@@ -137,6 +138,13 @@ public AkkaRpcService(
 
         captureAskCallstacks = configuration.captureAskCallStack();
 
+        // Akka always sets the threads context class loader to the class 
loader with which it was
+        // loaded (i.e., the plugin class loader)
+        // we must ensure that the context class loader is set to the Flink 
class loader when we
+        // call into Flink
+        // otherwise we could leak the plugin class loader or poison the 
context class leader of
+        // external threads (because they inherit the current threads context 
class loader)
+        internalExecutor = new 
ContextClassLoaderCleaningExecutor(actorSystem.dispatcher());

Review comment:
       I have not measured the performance impact, but I would doubt that it is 
significant.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to