wombatu-kun commented on code in PR #8962:
URL: https://github.com/apache/paimon/pull/8962#discussion_r3705166499
##########
paimon-common/src/main/java/org/apache/paimon/fs/FileIO.java:
##########
@@ -655,10 +660,16 @@ static FileIOLoader checkAccess(FileIOLoader fileIO, Path
path, CatalogContext c
return null;
}
- // check access
+ // check access, the probe is thrown away afterwards so it has to be
released here: with
+ // the Hadoop file system cache disabled its exists() call creates a
file system that no
+ // one else can reach
FileIO io = fileIO.load(path);
- io.configure(config);
- io.exists(path);
+ try {
+ io.configure(config);
+ io.exists(path);
+ } finally {
+ IOUtils.closeQuietly(io);
Review Comment:
Done bd9a8d990. `checkAccess` returns the instance it checked and
`FileIO.get` hands that one back, which also stops the file system being built
twice. That changed its return type from `FileIOLoader` to `FileIO`, a
signature change on a `@Public` interface with no other callers in the repo.
The selection is also wrapped now, because an unchecked failure from a loader's
`requiredOptions()` or `getScheme()` would otherwise strand the checked
instance.
--
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]