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

chenzihao commented on FLINK-26861:
-----------------------------------

Hi, [~kkl0u]. Can you help to confirm this? 
cc: [~gaoyunhaii], [~MartijnVisser]

> Log cannot be printed completely when use System.exit(1)
> --------------------------------------------------------
>
>                 Key: FLINK-26861
>                 URL: https://issues.apache.org/jira/browse/FLINK-26861
>             Project: Flink
>          Issue Type: Bug
>          Components: Client / Job Submission, Deployment / YARN
>    Affects Versions: 1.12.2
>            Reporter: chenzihao
>            Priority: Major
>         Attachments: image-2022-03-25-16-35-27-550.png, 
> image-2022-03-25-16-35-39-531.png, image-2022-03-25-16-35-46-528.png
>
>
> When I use Yarn-Application mode to submit Flink Job and there exist an 
> exception expected, but I cannot get it in jobmanager log. And I only get the 
> exit code 1 in yarn log.
> !image-2022-03-25-16-35-27-550.png!
> h2. Relative code
> {code:java}
> // YarnApplicationClusterEntryPoint#main
> try {
>     program = getPackagedProgram(configuration);
> } catch (Exception e) {
>     LOG.error("Could not create application program.", e);
>     Thread.sleep(10); // add this for test
>     System.exit(1);
> }
> {code}
> h2. Log info
>  * The ERROR log doesn't exist before Thread.sleep.
> !image-2022-03-25-16-35-39-531.png!
>  * The ERROR log exists after Thread.sleep.
> !image-2022-03-25-16-35-46-528.png!
> h2. Reason
> System.exit() terminates the currently running Java Virtual Machine too fast 
> to print the ERROR log.
> h2. Improvement
> I think we can print the ERROR log to jobmanager.err before call 
> System.exit(1) so that we can get the exception info.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to