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



##########
File path: 
flink-rpc/flink-rpc-akka/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java
##########
@@ -144,12 +147,21 @@ public void postStop() throws Exception {
     @Override
     public Receive createReceive() {
         return ReceiveBuilder.create()
-                .match(RemoteHandshakeMessage.class, 
this::handleHandshakeMessage)
-                .match(ControlMessages.class, this::handleControlMessage)
-                .matchAny(this::handleMessage)
+                .match(
+                        RemoteHandshakeMessage.class,
+                        
withCleanContextClassLoader(this::handleHandshakeMessage))
+                .match(
+                        ControlMessages.class,
+                        
withCleanContextClassLoader(this::handleControlMessage))
+                .matchAny(withCleanContextClassLoader(this::handleMessage))

Review comment:
       Stepping into Flink land should only happen in `handleMessage` but not 
the other cases. Ideally, I would like clearly draw a boundary between the rpc 
service and Flink land and only set the context class loader when entering one 
of them.




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