You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2020/02/28 13:04:29 UTC
[hadoop] branch trunk updated: HDFS-15199. NPE in BlockSender.
Contributed by Ayush Saxena.
This is an automated email from the ASF dual-hosted git repository.
surendralilhore pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new fccfb02 HDFS-15199. NPE in BlockSender. Contributed by Ayush Saxena.
fccfb02 is described below
commit fccfb02672178d05f9d804f3a40f6b6b7d11efeb
Author: Surendra Singh Lilhore <su...@apache.org>
AuthorDate: Fri Feb 28 18:33:06 2020 +0530
HDFS-15199. NPE in BlockSender. Contributed by Ayush Saxena.
---
.../hadoop/hdfs/server/datanode/BlockSender.java | 27 ++++++++++++----------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
index 4b1d17c..6102a59 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
@@ -641,18 +641,21 @@ class BlockSender implements java.io.Closeable {
* It was done here because the NIO throws an IOException for EPIPE.
*/
String ioem = e.getMessage();
- /*
- * If we got an EIO when reading files or transferTo the client socket,
- * it's very likely caused by bad disk track or other file corruptions.
- */
- if (ioem.startsWith(EIO_ERROR)) {
- throw new DiskFileCorruptException("A disk IO error occurred", e);
- }
- if (!ioem.startsWith("Broken pipe") && !ioem.startsWith("Connection reset")) {
- LOG.error("BlockSender.sendChunks() exception: ", e);
- datanode.getBlockScanner().markSuspectBlock(
- ris.getVolumeRef().getVolume().getStorageID(),
- block);
+ if (ioem != null) {
+ /*
+ * If we got an EIO when reading files or transferTo the client
+ * socket, it's very likely caused by bad disk track or other file
+ * corruptions.
+ */
+ if (ioem.startsWith(EIO_ERROR)) {
+ throw new DiskFileCorruptException("A disk IO error occurred", e);
+ }
+ if (!ioem.startsWith("Broken pipe")
+ && !ioem.startsWith("Connection reset")) {
+ LOG.error("BlockSender.sendChunks() exception: ", e);
+ datanode.getBlockScanner().markSuspectBlock(
+ ris.getVolumeRef().getVolume().getStorageID(), block);
+ }
}
}
throw ioeToSocketException(e);
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org