You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "eBugs in Cloud Systems (JIRA)" <ji...@apache.org> on 2019/05/06 15:12:00 UTC

[jira] [Updated] (YARN-9531) AllocationFileLoaderService.getAllocationFile() throws a RuntimeException if it can't find the file on the local filesystem

     [ https://issues.apache.org/jira/browse/YARN-9531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

eBugs in Cloud Systems updated YARN-9531:
-----------------------------------------
    Summary: AllocationFileLoaderService.getAllocationFile() throws a RuntimeException if it can't find the file on the local filesystem  (was: AllocationFileLoaderService.getAllocationFile() throws a RuntimeException it can't find the file on the local filesystem)

> AllocationFileLoaderService.getAllocationFile() throws a RuntimeException if it can't find the file on the local filesystem
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-9531
>                 URL: https://issues.apache.org/jira/browse/YARN-9531
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: eBugs in Cloud Systems
>            Priority: Minor
>
> 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 seem to indicate different error conditions.
>  
> Version: Hadoop-3.1.2
> File: HADOOP-ROOT/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationFileLoaderService.java
> Line: 199-200
> {code:java}
> throw new RuntimeException("Allocation file " + url
>     + " found on the classpath is not on the local filesystem.");{code}
>  
> {{RuntimeException}} is usually used to represent errors in the program logic (think of one of its subclasses, {{NullPointerException}}), while the error message indicates that {{getAllocationFile()}} can't find the allocation file on the local filesystem. Will this mismatch be a problem? For example, will the callers miss the case where {{getAllocationFile()}} fails to find the file? Or, will the callers trying to handle other {{RuntimeException}} accidentally (and incorrectly) handle the file not found scenario? Is a {{FileNotFoundException}} better here?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org