Skip to content

test: account for CRT sync 5xx connection rotation#147

Merged
dkropachev merged 1 commit into
mainfrom
dk/relax-crt-5xx-connection-reuse-test
Jul 21, 2026
Merged

test: account for CRT sync 5xx connection rotation#147
dkropachev merged 1 commit into
mainfrom
dk/relax-crt-5xx-connection-reuse-test

Conversation

@dkropachev

@dkropachev dkropachev commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • document the AWS CRT sync 5xx connection reuse behavior in README
  • allow the CRT sync client to rotate one connection after HTTP 5xx responses
  • keep the test asserting that 5xx responses do not force one connection per request in the current probe

CRT 5xx behavior checked

  • AWS SDK CRT sync response handling treats HTTP 5xx server errors as a condition where the native CRT connection may be closed instead of returned to the pool.
  • There is no public AwsCrtHttpClient.Builder option to disable that status-code close behavior.
  • Local Java 11 runs with AWS SDK 2.42.2 observed 1 TCP connection for five sequential 500 responses across five repeated runs.
  • CI previously observed 2 TCP connections for the same five-response probe, so the assertion permits one replacement connection while still catching per-request connection churn.

Testing

  • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH mvn -q -Dtest=HttpClientNon2xxConnectionReuseTest test
  • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH mvn -q fmt:check checkstyle:check

@dkropachev
dkropachev force-pushed the dk/relax-crt-5xx-connection-reuse-test branch from e10cc4d to 73f3495 Compare July 21, 2026 17:18
AWS CRT sync treats HTTP 5xx server errors as a condition where the native connection may be closed instead of returned to the pool, and the SDK does not expose a builder option to disable that behavior.

Document the behavior and relax the non-2xx reuse assertion to allow one replacement connection across five sequential 500 responses while still catching per-request connection churn.
@dkropachev
dkropachev force-pushed the dk/relax-crt-5xx-connection-reuse-test branch from 73f3495 to eeb142f Compare July 21, 2026 17:36
@dkropachev dkropachev changed the title test: relax CRT 5xx connection reuse assertion test: account for CRT sync 5xx connection rotation Jul 21, 2026
@dkropachev
dkropachev merged commit 6cbbc5e into main Jul 21, 2026
8 of 10 checks passed
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.

1 participant