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


##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java:
##########
@@ -324,10 +368,18 @@ public void onDone(Exchange exchange) {
                         skipped++;
                         continue;
                     }
-                    LOG.warn("Error getting MinioObject due: {}", 
e.getMessage());
-                    // this and the remaining exchanges of the batch are not 
processed
-                    releaseInProgress(srcObjectName, exchanges);
-                    throw e;
+                    if (objectNameConfigured()) {
+                        LOG.warn("Error getting MinioObject due: {}", 
e.getMessage());
+                        // the one object of the poll is not processed
+                        releaseInProgress(srcObjectName, exchanges);
+                        throw e;
+                    }
+                    // a failure to get one listed object does not stop the 
other objects of the batch: the object is
+                    // skipped, and a later poll tries it again
+                    inProgress.remove(srcObjectName);
+                    skipped++;
+                    failures.put(srcObjectName, e);
+                    continue;

Review Comment:
   Done in 040a7cd4e963: `releaseExchange(exchange, false)` runs as soon as the 
get fails, before the NoSuchKey, `objectName` and skip branches, so all three 
return the exchange. The new 
`MinioConsumerObjectThatCannotBeGotPooledExchangeTest` (pooled exchanges, 
statistics on) checks that 3 exchanges are created and 3 released when b.txt's 
get is refused. Without the release it fails with `expected: <3> but was: <2>`.
   
   _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