steveloughran commented on code in PR #5847:
URL: https://github.com/apache/hadoop/pull/5847#discussion_r1267028844
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemClose.java:
##########
@@ -17,26 +17,26 @@
*/
package org.apache.hadoop.fs.viewfs;
+import static org.apache.hadoop.test.LambdaTestUtils.intercept;
Review Comment:
can you put the static imports right down at the bottom, just above the
class declaration?
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java:
##########
@@ -1926,12 +1926,41 @@ enum RenameStrategy {
SAME_FILESYSTEM_ACROSS_MOUNTPOINT
}
+ private void closeChildFileSystems(FileSystem fs) throws IOException {
+ if (fs != null) {
+ FileSystem[] childFs = fs.getChildFileSystems();
+ for (FileSystem child : childFs) {
+ if (child != null) {
+ String disableCacheName = String.format("fs.%s.impl.disable.cache",
+ child.getUri().getScheme());
+ if (config.getBoolean(disableCacheName, false)) {
+ child.close();
Review Comment:
do failures need to be handled here? if so: what?
any fs set to delete files on close may raise exceptions here from
permissions...should they be ignored, fail fast (as this pr does) or should we
try best effort to close the others.
The simple patch here is better than today, so i'm not too worried -and that
delete on close stuff isn't something to use in production
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]