[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Affects Version/s: (was: 0.20.205.0) Fix Version/s: (was: 0.20.205.0) > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Attachment: HDFS-1934-1.patch Attaching a patch which addresses this problem. > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Attachment: HDFS-1934-2.patch Adding this check at another location. So the updated patch. > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Attachment: HDFS-1934-3.patch Thanks for reviewing this patch, Jakob. > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch, HDFS-1934-3.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Status: Patch Available (was: Open) > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch, HDFS-1934-3.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Attachment: HDFS-1934-4.patch Thanks for reviewing, Matt. Attaching the patch with this change. > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch, HDFS-1934-3.patch, > HDFS-1934-4.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HDFS-1934) Fix NullPointerException when certain File APIs return null
[ https://issues.apache.org/jira/browse/HDFS-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath Mundlapudi updated HDFS-1934: - Attachment: HDFS-1934-5.patch Reattaching a patch with minor correction for logging. > Fix NullPointerException when certain File APIs return null > --- > > Key: HDFS-1934 > URL: https://issues.apache.org/jira/browse/HDFS-1934 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 0.23.0 >Reporter: Bharath Mundlapudi >Assignee: Bharath Mundlapudi > Fix For: 0.23.0 > > Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch, HDFS-1934-3.patch, > HDFS-1934-4.patch, HDFS-1934-5.patch > > > 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. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira