HDFS-15403. NPE in FileIoProvider#transferToSocketFully. Contributed by hemanthboyina.

(cherry picked from commit f41a144077)
This commit is contained in:
Takanobu Asanuma 2020-06-15 09:15:53 +09:00
parent 534b15caf9
commit 3b8418250f
1 changed files with 6 additions and 1 deletions

View File

@ -280,7 +280,12 @@ public class FileIoProvider {
profilingEventHook.afterFileIo(volume, TRANSFER, begin, count);
} catch (Exception e) {
String em = e.getMessage();
if (!em.startsWith("Broken pipe") && !em.startsWith("Connection reset")) {
if (em != null) {
if (!em.startsWith("Broken pipe")
&& !em.startsWith("Connection reset")) {
onFailure(volume, begin);
}
} else {
onFailure(volume, begin);
}
throw e;