-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress NoSuchFileException in LocalFileIterator #20526
Conversation
72a91bb
to
0d4cb0d
Compare
lib/trino-filesystem/src/main/java/io/trino/filesystem/local/LocalFileIterator.java
Show resolved
Hide resolved
Please get @electrum to review this before merging. The exact behavior of exceptions from the file system implementations is required to be consistent, and I'd like david to make sure this is following the expected behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Javadoc for listFiles()
says
If the location does not exist, an empty iterator is returned.
For hierarchical file systems, if the path is not a directory, an exception is raised.
The expectation is that it only throws in the above case, or if there is a network error or similar. We should never see NoSuchFileException
in FileHiveMetastore
for listFiles()
. If we do, that's a bug in the file system implementation.
So I believe that the first commit is correct and the second commit is not needed. |
@electrum Both commits are required to fix the concurrent issue. |
Thanks for explaining. We should change |
@ebyhr did you consider making use of a simplified version of |
0d4cb0d
to
26e0ff7
Compare
Description
Files.walk method may throw an exception during the iteration. https://bugs.openjdk.org/browse/JDK-8039910
Fixes #20520
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.