[ 
https://issues.apache.org/jira/browse/FLINK-24455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424642#comment-17424642
 ] 

Aitozi commented on FLINK-24455:
--------------------------------

More information about local debug the two case:

1. _run 'mvn package -pl 
flink-rpc/flink-rpc-akka,flink-rpc/flink-rpc-akka-loader' on the command-line_ .

Debugging this case, I found that the new created submodule classloader only 
contains the dependency of flink-rpc-akka.jar, which does not contain 
{{RpcSystem.class}}. In the phase of loadClass of {{AkkaRpcSystem}}, it will 
try to load it's parent class, then fails with ClassNotFoundException using 
submodule classloader, because the {{RpcSystem.class}} is not in 
flink-rpc-akka.jar. Then it will be loaded by ownerClassLoader (AppClassLoader) 
successfully.

After that loaded {{AkkaRpcSystem#SubmoduleClassloader}} inherited from 
{{RpcSystem#AppClassloader}} . It can pass when check 
{{RpcSystem.class.isAssignableFrom(AkkaRpcSystem.class)}} . I am a little 
confused here about how does two class loaded by different classloader can work 
with {{isAssignableFrom}}, but it works. please give me some hints, if you have 
idea [~chesnay] :) .

2. _add a test dependency on the flink-rpc-akka-loader test-jar_.

It adds the flink-rpc-core to Submodule classloader classpath, so when load 
{{AkkaPrcSystem}}, it will reload the {{RpcSystem}} with 
{{SubmoduleClassloader}}, which lead to the **not a subtype** exception above.

!screenshot-1.png!

> Flink runtime test can't work with FallbackAkkaRpcSystemLoader
> --------------------------------------------------------------
>
>                 Key: FLINK-24455
>                 URL: https://issues.apache.org/jira/browse/FLINK-24455
>             Project: Flink
>          Issue Type: Bug
>          Components: Tests
>            Reporter: Aitozi
>            Priority: Major
>         Attachments: image-2021-10-06-00-27-19-848.png, screenshot-1.png
>
>
> After [FLINK-24367|https://github.com/apache/flink/pull/17385/files], a 
> {{FallbackAkkaRpcSystemLoader}} is provided, which should make it possible to 
> run test directly without execute {{mvn package -pl 
> flink-rpc/flink-rpc-akka,flink-rpc/flink-rpc-akka-loader}} in command line, 
> but I still meet the exception 
>  !image-2021-10-06-00-27-19-848.png! 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to