HADOOP-15748. S3 listing inconsistency can raise NPE in globber.
Contributed by Steve Loughran. (cherry picked from commit 646874c326139457b79cf8cfa547b3c91a78c7b4)
This commit is contained in:
parent
d2655ea60c
commit
fc6d851f70
@ -245,7 +245,18 @@ private FileStatus[] doGlob() throws IOException {
|
||||
// incorrectly conclude that /a/b was a file and should not match
|
||||
// /a/*/*. So we use getFileStatus of the path we just listed to
|
||||
// disambiguate.
|
||||
if (!getFileStatus(candidate.getPath()).isDirectory()) {
|
||||
Path path = candidate.getPath();
|
||||
FileStatus status = getFileStatus(path);
|
||||
if (status == null) {
|
||||
// null means the file was not found
|
||||
LOG.warn("File/directory {} not found:"
|
||||
+ " it may have been deleted."
|
||||
+ " If this is an object store, this can be a sign of"
|
||||
+ " eventual consistency problems.",
|
||||
path);
|
||||
continue;
|
||||
}
|
||||
if (!status.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user