eBugs in Cloud Systems created YARN-9531:
--------------------------------------------
Summary: AllocationFileLoaderService.getAllocationFile() throws a
RuntimeException 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
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: [email protected]
For additional commands, e-mail: [email protected]