Skip to content

[DO NOT MERGE] Merge CRT H2 Support#6729

Open
zoewangg wants to merge 5 commits intomasterfrom
feature/master/crtH2
Open

[DO NOT MERGE] Merge CRT H2 Support#6729
zoewangg wants to merge 5 commits intomasterfrom
feature/master/crtH2

Conversation

@zoewangg
Copy link
Contributor

Merge CRT H2 Support

* Add CRT HTTP/2 support

* Update CRT version and re-add back comments
# Conflicts:
#	pom.xml
@zoewangg zoewangg requested a review from a team as a code owner February 11, 2026 21:02
private final HttpExecuteRequest request;
private final long readBufferSize;
private final HttpClientConnectionManager crtConnPool;
private final HttpStreamManager crtConnPool;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivial: maybe rename this? It's not a connection pool anymore?

Comment on lines +68 to +69
// TODO: check with CRT team, could CRT_SOCKET_TIMEOUT be thrown
// from processes other than tcp connect?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure I follow this questions?

https://github.com/awslabs/aws-crt-java/pull/928/changes#diff-48bd13e1ade21ddbc9fb312b7f0dfdafb183e1fd59058919ca2c55ce53987ce2R504
We recently added this method to better identify the error is supported to be retry or not.

We basically take a list from io, here, and a list from http, here, to be retryable and everything else is not retryable. (Note that we took AWS_IO_SOCKET_TIMEOUT as retryable)

I think this logic should probably be something like:

  1. if the error code is retryable, wrap it with retry
  2. Else if error is CRT_TLS_NEGOTIATION_ERROR_CODE, wrap it with ssl exception
  3. Anything else is probably a connect exception

Copy link
Contributor Author

@zoewangg zoewangg Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll update the code to use CRT.awsIsTransientError()) instead. The reason we have this logic is to special case (retryable) errors from TCP connect, my question is: is there a way to tell if a retryable error is from TCP connect? If we go with the logic you proposed, it'd be wrapped with a generic IOException in step 1

Comment on lines +78 to +84
ClientBootstrap clientBootstrap = new ClientBootstrap(null, null);
SocketOptions clientSocketOptions = buildSocketOptions(builder.getTcpKeepAliveConfiguration(),
config.get(SdkHttpConfigurationOption.CONNECTION_TIMEOUT));
TlsContextOptions clientTlsContextOptions =
TlsContextOptions.createDefaultClient()
.withCipherPreference(resolveCipherPreference(builder.getPostQuantumTlsEnabled()))
.withVerifyPeer(!config.get(SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we remove the try with resource block? Maybe I am not following the logic, but where do we clean up these resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So previously, we have this subresource.addRef() process to increase reference every time we use it and then try with resource to close it. I just removed both to keep the logic simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants