dianfu commented on a change in pull request #10870: [FLINK-15616][python] Move 
boot error messages from python-udf-boot.log to taskmanager's log file
URL: https://github.com/apache/flink/pull/10870#discussion_r367830927
 
 

 ##########
 File path: 
flink-python/src/main/java/org/apache/flink/python/AbstractPythonFunctionRunner.java
 ##########
 @@ -176,10 +179,29 @@ public void open() throws Exception {
                Struct pipelineOptions = 
PipelineOptionsTranslation.toProto(portableOptions);
 
                jobBundleFactory = createJobBundleFactory(pipelineOptions);
-               stageBundleFactory = 
jobBundleFactory.forStage(createExecutableStage());
+               stageBundleFactory = createStageBundleFactory();
                progressHandler = BundleProgressHandler.ignored();
        }
 
+       /**
+        * To make the error messages more user friendly, read the boot logs 
from the temp log file and
+        * throw an exception directly.
+        */
+       private StageBundleFactory createStageBundleFactory() throws Exception {
+               try {
+                       return 
jobBundleFactory.forStage(createExecutableStage());
+               } catch (Exception e) {
+                       byte[] output =
+                               Files.readAllBytes(
 
 Review comment:
   Should we check if the log file exists?

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


With regards,
Apache Git Services

Reply via email to