Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Dear HDFS 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-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
Line: 1070
throw new IOException("Interrupted receiveBlock");
An IOException can mean many different errors, while the error message indicates that receiveBlock() is interrupted. This mismatch could be a problem. For example, the callers trying to handle other IOException may accidentally (and incorrectly) handle the interrupt. An InterruptedIOException may be better here.