allthingssecurity commented on code in PR #27645:
URL: https://github.com/apache/camel/pull/27645#discussion_r4236674722


##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java:
##########
@@ -224,12 +225,37 @@ protected Deque<Exchange> 
createExchanges(Iterator<Result<Item>> minioObjectSumm
 
         } catch (Exception e) {
             LOG.warn("Error getting MinioObject due: {}", e.getMessage());
+            // none of the objects of this poll is processed
+            releaseInProgress(null, answer);
             throw e;
         }
 
         return answer;
     }
 
+    private void addExchange(String objectName, Deque<Exchange> answer) throws 
Exception {
+        // skip the object if an exchange of a previous poll is still 
processing it
+        if (!inProgress.add(objectName)) {
+            LOG.trace("Skipping object {} as it is already in progress", 
objectName);
+            return;
+        }
+        try {
+            answer.add(createExchange(objectName));

Review Comment:
   Done in 02f762332c: a listed object whose stat or get fails with `NoSuchKey` 
is released and skipped, and the rest of the batch is still processed 
(`objectName` mode still fails at the stat, as before). New 
`MinioConsumerDeletedObjectTest` uses the fake S3 server to delete one object 
before the stat and one before the get; it fails without the change.
   
   _Claude Code on behalf of allthingssecurity_



-- 
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