eBugs in Cloud Systems created HBASE-22369:
----------------------------------------------
Summary: CoprocessorClassLoader.init() throws RuntimeException
when it fails to create a directory
Key: HBASE-22369
URL: https://issues.apache.org/jira/browse/HBASE-22369
Project: HBase
Issue Type: Bug
Affects Versions: 2.1.4
Reporter: eBugs in Cloud Systems
Dear HBase 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.
Since we are not very familiar with HBase's internal work flow, could you
please help us verify if this is a bug, i.e., will the callers have trouble
handling the exception, and will the users/admins have trouble diagnosing the
failure?
Version: HBase-2.1.4
File:
HBASE-ROOT/hbase-common/src/java/org/apache/hbase/utils/obs/CoprocessorClassLoader.java
Line: 160-161
{code:java}
throw new RuntimeException("Failed to create local dir " + parentDirStr
+ ", CoprocessorClassLoader failed to init");{code}
Reason: {{RuntimeException}} is usually used to represent errors in the program
logic (think of one of its subclasses, {{NullPointerException}}), while the
error message indicates that {{init()}} failed to create a directory. Will this
mismatch be a problem? For example, will the callers miss the case where
{{init()}} fails to create a directory? Or, will the callers try to handle
other {{RuntimeException}} accidentally (and incorrectly) handle the directory
creation failure?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)