Repository navigation
Conversation
Cap how many requests per endpoint can wait once maxConcurrency is in use, matching the Netty client option. Unset means unbounded, as today. HTTP/2 needs an aws-crt release that honors the limit.
zoewangg
commented
Nov 6, 2026
| codes.add(2092); | ||
| // AWS_ERROR_HTTP_CONNECTION_MANAGER_ACQUISITION_TIMEOUT | ||
| codes.add(2093); | ||
| // AWS_ERROR_HTTP_CONNECTION_MANAGER_MAX_PENDING_ACQUISITIONS_EXCEEDED |
Contributor
Author
There was a problem hiding this comment.
Removing 2094 from the retryable codes doesn't change behavior for existing users because it was basically unreachable until now. aws-c-http only raises 2094 when max_pending_connection_acquisitions is set, and the SDK never set it (HttpClientConnectionManagerOptions.withMaxPendingConnectionAcquisitions was never called).
The reason we removed it here is to match netty behavior; we don't retry max pending acquisitions error for netty
This branch has not been deployed
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.
Motivation and Context
NettyNioAsyncHttpClient.BuilderhasmaxPendingConnectionAcquires, which limits how many requests to one endpoint can wait once all connections (HTTP/1.1) or streams (HTTP/2) are in use. The AWS CRT HTTP clients have no equivalent: waiting requests are unbounded. Workloads that rely on this option to shed load cannot move from Netty to the CRT client with the same behavior.Modifications
maxPendingConnectionAcquires(Integer)toAwsCrtAsyncHttpClient.BuilderandAwsCrtHttpClient.Builder, with the same name, type and meaning as the Netty option. It is implemented once in the shared builder base.nullmeans unbounded, which is the current CRT behavior. Netty's default is 10,000; the Javadoc says to set it explicitly to keep the Netty behavior when migrating.IllegalArgumentExceptionat the builder call.AttributeMap, soSdkHttpConfigurationOption.MAX_PENDING_CONNECTION_ACQUIRESfrom the global or service defaults does not apply to the CRT clients.HttpClientConnectionManagerOptions.withMaxPendingConnectionAcquisitionsonly when set. These are the connection-manager options the client already hands to the HTTP/2 stream manager.HttpException(error code 2094) and is not sent. 2094 is removed from the CRT client's additionally-retryable error codes, so the rejection is not retried, matching Netty. Before this change, the SDK never set the limit, so 2094 could not occur.connectionAcquisitionTimeoutandconnectionMaxIdleTimeonAwsCrtAsyncHttpClient.Buildernow describes their HTTP/2 behavior with the upcoming CRT release:Testing
AwsCrtMaxPendingConnectionAcquiresTest, using WireMock for HTTP/1.1 and an in-test HTTP/2 server:IOExceptionand has error code 2094;CrtUtilsTest: 2094 is returned unchanged, not wrapped as a retryableIOException.aws-crt-clientmodule build, on macOS with the default TLS stack and with s2n (AWS_CRT_USE_NON_FIPS_TLS_13=1): 396 tests run. The only failure is the HTTP/2 rejection test, which needs the upcoming aws-crt-java release; on 0.50.0 the third request waits instead of being rejected. Checkstyle, SpotBugs and the other static checks pass.mvn install.Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License