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:36:00 UTC
[jira] [Updated] (FLINK-26861) Log cannot be printed completely when use System.exit(1)
[ https://issues.apache.org/jira/browse/FLINK-26861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
chenzihao updated FLINK-26861:
------------------------------
Attachment: image-2022-03-25-16-35-46-528.png
image-2022-03-25-16-35-39-531.png
image-2022-03-25-16-35-27-550.png
Description:
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.
was:
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.
> 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)