Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.23.0
-
None
-
None
Description
While testing Disk Fail Inplace, We encountered the NPE from this part of the code.
File[] files = dir.listFiles();
for (File f : files) {
...
}
This is kinda of an API issue. When a disk is bad (or name is not a directory), this API (listFiles, list) return null rather than throwing an exception. This 'for loop' throws a NPE exception. And same applies to dir.list() API.
Fix all the places where null condition was not checked.
Attachments
Attachments
Issue Links
- is blocked by
-
HADOOP-7322 Adding a util method in FileUtil for JDK File.listFiles
- Closed
- is depended upon by
-
HDFS-2023 Backport of NPE for File.list and File.listFiles
- Closed
- is related to
-
HDFS-2137 Datanode Disk Fail Inplace
- Resolved