You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "chenzihao (Jira)" <ji...@apache.org> on 2022/03/25 08:12:00 UTC
[jira] [Commented] (FLINK-26859) Log cannot be printed completely when use System.exit(1)
[ https://issues.apache.org/jira/browse/FLINK-26859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17512246#comment-17512246 ]
chenzihao commented on FLINK-26859:
-----------------------------------
Hi, [~kkl0u]. Can you help to confirm this?
> Log cannot be printed completely when use System.exit(1)
> --------------------------------------------------------
>
> Key: FLINK-26859
> URL: https://issues.apache.org/jira/browse/FLINK-26859
> Project: Flink
> Issue Type: Bug
> Components: Deployment / YARN
> Affects Versions: 1.12.2
> Reporter: chenzihao
> Priority: Major
> Attachments: image-2022-03-25-15-43-11-310.png, image-2022-03-25-15-43-53-992.png, image-2022-03-25-15-46-44-935.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-15-46-44-935.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-15-43-11-310.png!
> * The ERROR log exists after Thread.sleep.
> !image-2022-03-25-15-43-53-992.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)