[ https://issues.apache.org/jira/browse/KAFKA-3940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15423669#comment-15423669 ]
ASF GitHub Bot commented on KAFKA-3940: --------------------------------------- GitHub user imandhan opened a pull request: https://github.com/apache/kafka/pull/1748 KAFKA-3940 Log should check the return value of dir.mkdirs() This commit changes all the occurrences of dir.mkdirs() with Files.createDirectory(dir.toPath()) You can merge this pull request into a Git repository by running: $ git pull https://github.com/imandhan/kafka KAFKA-3940 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1748.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1748 ---- commit baf70497759e636a55d50f03d0c5a9673ac71d2d Author: Ishita Mandhan <iman...@us.ibm.com> Date: 2016-08-17T00:32:22Z KAFKA-3940 Log should check the return value of dir.mkdirs() This commit changes all the occurrences of dir.mkdirs() with Files.createDirectory(dir.toPath()) ---- > Log should check the return value of dir.mkdirs() > ------------------------------------------------- > > Key: KAFKA-3940 > URL: https://issues.apache.org/jira/browse/KAFKA-3940 > Project: Kafka > Issue Type: Bug > Components: log > Affects Versions: 0.10.0.0 > Reporter: Jun Rao > Assignee: Ishita Mandhan > Labels: newbie > > In Log.loadSegments(), we call dir.mkdirs() w/o checking the return value and > just assume the directory will exist after the call. However, if the > directory can't be created (e.g. due to no space), we will hit > NullPointerException in the next statement, which will be confusing. > for(file <- dir.listFiles if file.isFile) { -- This message was sent by Atlassian JIRA (v6.3.4#6332)