allthingssecurity opened a new pull request, #28130:
URL: https://github.com/apache/camel/pull/28130

   # Description
   
   [CAMEL-25770](https://issues.apache.org/jira/browse/CAMEL-25770)
   
   The blob consumer lists the whole container at every poll and gets every 
listed blob when it creates the exchanges. A blob that no longer exists is 
skipped (CAMEL-25551); any other failure of a get was rethrown and failed the 
poll. As every poll lists the container again, one blob whose get always fails 
stopped the consumer from consuming any blob. The most common case is a blob 
that a lifecycle management rule moved to the archive tier: reading it fails 
with 409 BlobArchived until it is rehydrated. Access denied for one blob is 
another.
   
   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 blob is collected, the blob is skipped for this 
poll and reported to the consumer's exception handler with its name, and the 
other listed blobs are consumed;
   - the poll still fails (with the first failure) when none of the listed 
blobs could be got, as for expired credentials, so the error handling and the 
backoff of the scheduled consumer apply;
   - a failure with `blobName` set, and a failure of the listing, are not 
changed.
   
   The behaviour change (a skipped blob is reported at every poll that lists 
it) is in the 4.24 upgrade guide.
   
   Tests:
   - New `BlobConsumerBlobThatCannotBeGotTest` (2 tests) with the mocked 
`BlobServiceClient` of `BlobConsumerInProgressTest`; the get of an archived 
blob throws a `BlobStorageException` with status 409. Without the fix 
`blobThatCannotBeGotDoesNotBlockTheOtherBlobs` (a.txt, archived b.txt, c.txt) 
receives no blob at all. `pollFailsWhenNoListedBlobCanBeGot` passes with and 
without the fix; it is there because the fix must not swallow that case.
   - camel-azure-storage-blob unit tests: 66 run, 0 failures (formatter and 
import sort run in the same build).
   - Not run: against Azure Storage. The 409 BlobArchived answer is from the 
Azure Storage documentation.
   
   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 
gets every listed item in one try block and rethrows the first failure). 
camel-minio, camel-google-storage and camel-azure-storage-datalake have the 
same defect and are fixed in separate PRs. This PR does not overlap with the 
moveAfterRead fix of CAMEL-25758 (different methods of `BlobConsumer`).
   
   # 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-blob, 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]

Reply via email to