[
https://issues.apache.org/jira/browse/YARN-9532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18040005#comment-18040005
]
ASF GitHub Bot commented on YARN-9532:
--------------------------------------
github-actions[bot] closed pull request #3709: YARN-9532. SLSRunner.run()
throws a YarnException when it fails to cr…
URL: https://github.com/apache/hadoop/pull/3709
> SLSRunner.run() throws a YarnException when it fails to create the output
> directory
> -----------------------------------------------------------------------------------
>
> Key: YARN-9532
> URL: https://issues.apache.org/jira/browse/YARN-9532
> Project: Hadoop YARN
> Issue Type: Bug
> Reporter: Haicheng Chen
> Assignee: Minni Mittal
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Dear YARN developers, we are developing a tool to detect exception-related
> bugs in Java. Our prototype has spotted the following {{throw}} statement
> whose exception class and error message indicate different error conditions.
>
> Version: Hadoop-3.1.2
> File:
> HADOOP-ROOT/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
> Line: 894
> {code:java}
> if (!outputFile.exists() && !outputFile.mkdirs()) {
> System.err.println("ERROR: Cannot create output directory "
> + outputFile.getAbsolutePath());
> throw new YarnException("Cannot create output directory");
> }{code}
>
> The exception is triggered when {{run()}} fails to create the output
> directory (as indicated by the {{if}} condition and the error message).
> However, throwing a {{YarnException}} is too general and makes accurate
> exception handling more difficult. Since the error is related to I/O,
> throwing an {{IOException}}, or wrapping an {{IOException}} could be better.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]