Samrat002 commented on code in PR #27970:
URL: https://github.com/apache/flink/pull/27970#discussion_r3110726922


##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3BulkCopyHelper.java:
##########
@@ -181,8 +226,42 @@ private void 
waitForCopies(List<CompletableFuture<CompletedCopy>> futures) throw
             Thread.currentThread().interrupt();
             throw new IOException("Bulk copy interrupted", e);
         } catch (ExecutionException e) {
-            throw new IOException("Bulk copy failed", e.getCause());
+            Throwable cause = e.getCause();
+            if (isConnectionPoolExhausted(cause)) {

Review Comment:
   Yes. The clamping ensures `maxConcurrentCopies <= maxConnections`, but 
S3TransferManager uses multipart downloads for files larger than 8MB. Each part 
opens a separate HTTP connection from the shared pool. So with 
`maxConcurrentCopies=10` and `maxConnections=10`, downloading 10 large files 
simultaneously, where each splits into 4 parts = 40 connections needed from a 
pool of 10.                                                                     
                                                            
                                                                                
                                                                                
                        
   The clamping eliminates the obvious case (concurrency alone exceeding the 
pool). This detection handles the remaining case where the per-file connection 
multiplier, which depends on runtime file sizes and is not known at 
configuration time, causes exhaustion. Without it, the operator gets a raw SDK 
timeout `Acquire operation took longer than the configured maximum time` with 
no indication of what to do. With it, they get an actionable message pointing 
to both config keys.



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