[Bug] [dinky-client]Submitting a JAR task to the Kubernetes (k8s) Flink application (version 1.19.1) results in a ClassNotFoundException, as it cannot find the Protobuf classes contained within the JAR task. #4104
Labels
Bug
Something isn't working
Search before asking
What happened
In higher versions of Flink, the construction method for the class loader has changed (for example, org.apache.flink.runtime.execution.librarycache.BlobLibraryCacheManager.getOrResolveClassLoader()).
If the pipeline.jars of the JAR task are not correctly passed during task execution, the class loaders constructed by the JobMaster and TaskManager will not load the classes within the JAR. This results in a ClassNotFoundException when the JobMaster tries to deserialize job data during initialization because it cannot find the necessary classes.
Dinky calls addJar after downloading the JAR, but this only adds the configuration for the tableEnv. However, the configuration for executing the JAR pipeline comes from streamEnv, leading to a situation where the pipeline.jars in the submitted task's configuration only contains [file:/dinky/dinky-app-1.19-1.2.0-jar-with-dependencies.jar] instead of including the task's JAR as well.
After modifying the addJar() method in org.dinky.executor.CustomTableEnvironment, the classes within the JAR can now be loaded correctly.
Additionally, there is a similar issue with the addJar() method in org.dinky.executor.Executor. It appears that this method also suffers from the same problem regarding the usage of addJar syntax. However, since I have not utilized this feature yet, I have not made any modifications to it.
What you expected to happen
Successfully submit the JAR task to Kubernetes (k8s) and load the classes contained within it.
How to reproduce
1.Using Dinky version 1.2 with Flink version 1.19.1
2.Package the JAR task, ensuring that any Protobuf classes required during task execution are included within the JAR.
3.Submit the JAR task to a Kubernetes (k8s) Flink application cluster via Dinky.
Anything else
There is no issue with Flink 1.16.
Additionally, there is no problem when submitting JAR tasks to a Flink 1.19 Kubernetes session cluster via the web interface (Kubernetes Session Web).
Version
1.2.0
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: