This is an automated email from the ASF dual-hosted git repository.
sankarh pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new e0ffcbfc152 HIVE-27545: Backport HIVE-22273: Access check is failed
when a temporary directory is removed (Peter Vary reviewed by Marta Kuczora)
e0ffcbfc152 is described below
commit e0ffcbfc152e816fa1309e3fcaf015e3c66168d5
Author: Aman Raj <[email protected]>
AuthorDate: Fri Aug 11 12:40:39 2023 +0530
HIVE-27545: Backport HIVE-22273: Access check is failed when a temporary
directory is removed (Peter Vary reviewed by Marta Kuczora)
Signed-off-by: Sankar Hariappan <[email protected]>
Closes (#4528)
---
common/src/java/org/apache/hadoop/hive/common/FileUtils.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
index ec2f9f0ac89..f1f65b9b767 100644
--- a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
+++ b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
@@ -558,7 +558,13 @@ public final class FileUtils {
return true;
}
// check all children
- FileStatus[] childStatuses = fs.listStatus(fileStatus.getPath());
+ FileStatus[] childStatuses = null;
+ try {
+ childStatuses = fs.listStatus(fileStatus.getPath());
+ } catch (FileNotFoundException fe) {
+ LOG.debug("Skipping child access check since the directory is already
removed");
+ return true;
+ }
for (FileStatus childStatus : childStatuses) {
// check children recursively - recurse is true if we're here.
if (!checkIsOwnerOfFileHierarchy(fs, childStatus, userName, true)) {