allthingssecurity opened a new pull request, #28131: URL: https://github.com/apache/camel/pull/28131
# Description [CAMEL-25770](https://issues.apache.org/jira/browse/CAMEL-25770) The datalake consumer lists the whole file system at every poll and gets every listed file when it creates the exchanges, with no catch for one file. A failure of one get (access denied by the ACL of that file, a file encrypted with a key the consumer does not have) failed the poll, and a file deleted after the listing (404) ended the poll with no exchange at all. As every poll lists the file system again, one file that cannot be read stopped the consumer from consuming any file. In Data Lake Storage Gen2 every file has its own ACL, so a file the consumer may list but not read is a normal state. This change does what camel-aws2-s3 does since CAMEL-25558 (and what CAMEL-25760 does for camel-alibaba-oss and camel-huaweicloud-obs): - a failed get of one listed file is collected, the file is skipped for this poll and reported to the consumer's exception handler with its name, and the other listed files are consumed; - a file deleted after the listing is skipped at `DEBUG` instead of emptying the poll; - the poll still fails (with the first failure) when none of the listed files could be got, as for expired credentials, so the error handling and the backoff of the scheduled consumer apply; - a failure with `fileName` set, and a failure of the listing, are not changed. The behaviour changes are in the 4.24 upgrade guide. Tests: - New `DataLakeConsumerFileThatCannotBeGotTest` (3 tests) with a mocked `DataLakeServiceClient`; the read of a forbidden file throws a `DataLakeStorageException` with status 403, that of a deleted file status 404. Without the fix `fileThatCannotBeGotDoesNotBlockTheOtherFiles` (a.txt, forbidden b.txt, c.txt) and `fileDeletedAfterTheListingIsSkipped` (a.txt, deleted b.txt, c.txt) receive no file at all. `pollFailsWhenNoListedFileCanBeGot` passes with and without the fix; it is there because the fix must not swallow that case. - camel-azure-storage-datalake unit tests: 19 run, 0 failures (formatter and import sort run in the same build). - Not run: against Azure Storage. How it was found: variant analysis of the camel-aws2-s3 fix CAMEL-25558 across the object-store consumers (a Semgrep rule for a batch consumer that creates the exchange of every listed item, which downloads it, with no per-item catch). camel-minio, camel-google-storage and camel-azure-storage-blob have the same defect and are fixed in separate PRs. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested camel-azure-storage-datalake, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
