jiangxt2 opened a new issue, #55424: URL: https://github.com/apache/arrow/issues/55424
### Describe the bug, including details regarding any error messages, version, and platform. `HadoopFileSystem::GetFileInfo()` converts any `IOError` returned by the single-path `GetPathInfoStatus()` call to `FileType::NotFound`, without checking the underlying `errno`. As a result, errors such as permission failures, connection failures, timeouts, and I/O errors can be reported as missing paths. The branch is present in [Arrow 26.0.1](https://github.com/apache/arrow/blob/apache-arrow-26.0.1/cpp/src/arrow/filesystem/hdfs.cc#L154-L174) and in [main at commit `8eca523`](https://github.com/apache/arrow/blob/8eca523490e8f16ff029ec1707e5ff4121242e7c/cpp/src/arrow/filesystem/hdfs.cc#L154-L174). The underlying `GetPathInfoFailed()` constructs its status using `IOErrorFromErrno`, so the error code is available before the conversion. **Reproduction** A libhdfs ABI test double was used with native PyArrow 26.0.1 to inject `ENOENT`, `EACCES`, `ECONNREFUSED`, `ETIMEDOUT`, and `EIO`. The test ran on Debian 13.6, Linux x86_64, Python 3.12.14, the PyArrow manylinux228 wheel, GCC 14.2.0, and OpenJDK 21. All 36 checks passed. | Operation | Observed result | | --- | --- | | Single-path and list-of-paths `get_file_info` | All five injected errors returned `NotFound`. | | `FileSelector` with `allow_not_found=True` | When directory listing fails and the fallback path-info lookup also returns an `IOError`, `allow_not_found=True` can suppress the listing failure and return an empty result. | | Default strict `FileSelector` and `open_input_file` | The injected permission, connection, timeout, and I/O errors raised exceptions in this test. | The test double did not start a JVM or connect to a live HDFS cluster. Different Hadoop versions or distributions may map real failures to different errno values. The test double source, build instructions, and run instructions are not included in this report. **Expected behavior / question** Could `GetFileInfo()` return `NotFound` only for a confirmed missing-path error such as `ENOENT`, while propagating other errors? The appropriate treatment of `ENOTDIR` may need separate discussion against Arrow’s filesystem semantics. Callers may skip a path reported as missing, and the selector behavior described above could turn an access failure into an empty result. This is a potential incomplete-result risk; the test did not demonstrate actual data loss. [#12943](https://github.com/apache/arrow/pull/12943) addressed errno handling in a different HDFS operation; the `GetFileInfo` branch above remains affected. ### Component(s) C++, Python -- 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]
