Skip to content

Fix connection pool leak in AwsCrtHttpClient when threads are externally interrupted.#6896

Merged
aws-sdk-java-automation merged 3 commits intomasterfrom
alexwoo/fix_crt_connectionpool_interupt
Apr 24, 2026
Merged

Fix connection pool leak in AwsCrtHttpClient when threads are externally interrupted.#6896
aws-sdk-java-automation merged 3 commits intomasterfrom
alexwoo/fix_crt_connectionpool_interupt

Conversation

@alextwoods
Copy link
Copy Markdown
Contributor

Fix connection pool leak in AwsCrtHttpClient when threads are externally interrupted.

Motivation and Context

Connections can be leaked in the CRT HTTP client when a thread is interrupted externally (as opposed to interrupted by the SDK's own timeout mechanism).

Modifications

  • In AwsCrtHttpClient.CrtHttpRequest.call() when joinInterruptibly throws we complete the responseFutureexceptionally before
    propagating the exception. This triggers the exceptionally handler in the response handler,
    which calls closeConnection().

Testing

Added new unit test + manual reproduction of customer issue.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.

License

  • I confirm that this pull request can be released under the Apache 2 license

@alextwoods alextwoods requested a review from a team as a code owner April 23, 2026 19:20
@alextwoods alextwoods added the no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required label Apr 23, 2026
@alextwoods alextwoods enabled auto-merge April 23, 2026 22:04
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
66.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@alextwoods alextwoods added this pull request to the merge queue Apr 24, 2026
@davidh44 davidh44 removed this pull request from the merge queue due to a manual request Apr 24, 2026
@davidh44 davidh44 enabled auto-merge April 24, 2026 02:11
@davidh44 davidh44 added this pull request to the merge queue Apr 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 24, 2026
@alextwoods alextwoods added this pull request to the merge queue Apr 24, 2026
@alextwoods alextwoods removed this pull request from the merge queue due to a manual request Apr 24, 2026
@aws-sdk-java-automation aws-sdk-java-automation merged commit 57dd539 into master Apr 24, 2026
17 of 18 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants