[FLINK-39482][filesystem][backport] Support configurable maxConnections in S3ClientProvider#27986
Merged
gaborgsomogyi merged 1 commit intoapache:release-2.3from Apr 22, 2026
Merged
Conversation
Collaborator
gaborgsomogyi
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
During RocksDB state restore from S3, the
NativeS3BulkCopyHelpercan issue more concurrent download requests than the Netty HTTP connection pool can serve. When this happens, requests queue inside the pool and eventually hit the SDK's default 10-secondconnectionAcquisitionTimeout, causingAcquire operation took longer than the configured maximum acquisition timefailures.This PR fixes the issue with three changes:
Expose
s3.connection.max— newConfigOption<Integer>(default 50) so operators can tune the Netty connection pool size independently of the Apache HTTP pool used for sync operations.Clamp
maxConcurrentCopiestomaxConnections— if the configureds3.bulk-copy.max-concurrentexceedss3.connection.max, the helper automatically clamps it down and logs a WARN, following the same pattern used forREAD_BUFFER_SIZEclamping.Raise
connectionAcquisitionTimeout— align the Netty pool's acquisition timeout with the configureds3.client.connection-timeout(default 60s) instead of the SDK default of 10s, providing headroom under transient pressure.Brief change log
NativeS3FileSystemFactory: addMAX_CONNECTIONSconfig option, factory-level validation for bothMAX_CONNECTIONSandBULK_COPY_MAX_CONCURRENTNativeS3BulkCopyHelper: 3-arg constructor with clamping logic,isConnectionPoolExhausted()detection, enriched error message inwaitForCopies()NativeS3FileSystem: addgetBulkCopyHelper()package-private getter for test observabilityS3ClientProvider: wiremaxConnectionsandconnectionAcquisitionTimeoutinto Netty async HTTP client builderNativeS3BulkCopyHelperTest: parameterizedisConnectionPoolExhaustedtests, empty request list testNativeS3FileSystemFactoryTest: validation tests for invalid configs and clamping behaviorVerifying this change
This change is already verified by:
NativeS3BulkCopyHelperTest(29 tests) — clamping logic, pool exhaustion detection, URI parsingNativeS3FileSystemFactoryTest(29 tests) — invalids3.connection.max, invalids3.bulk-copy.max-concurrent, clamping through factory, config preserved within limitsDoes this pull request potentially affect one of the following parts
@Public(Evolving): noDocumentation
s3.connection.maxconfig option)