|
@@ -401,10 +401,19 @@ class BlockSender implements java.io.Closeable, FSConstants {
|
|
|
}
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
- /* exception while writing to the client (well, with transferTo(),
|
|
|
- * it could also be while reading from the local file).
|
|
|
+ /* Exception while writing to the client. Connection closure from
|
|
|
+ * the other end is mostly the case and we do not care much about
|
|
|
+ * it. But other things can go wrong, especially in transferTo(),
|
|
|
+ * which we do not want to ignore.
|
|
|
+ *
|
|
|
+ * The message parsing below should not be considered as a good
|
|
|
+ * coding example. NEVER do it to drive a program logic. NEVER.
|
|
|
+ * It was done here because the NIO throws an IOException for EPIPE.
|
|
|
*/
|
|
|
- LOG.error("BlockSender.sendChunks() exception: " + StringUtils.stringifyException(e));
|
|
|
+ String ioem = e.getMessage();
|
|
|
+ if (!ioem.startsWith("Broken pipe") && !ioem.startsWith("Connection reset")) {
|
|
|
+ LOG.error("BlockSender.sendChunks() exception: ", e);
|
|
|
+ }
|
|
|
throw ioeToSocketException(e);
|
|
|
}
|
|
|
|