Skip to content

Fix #3333: Close proxy connection if error response consumption fails - #3338

Merged
ok2c merged 1 commit into
apache:masterfrom
Aayush10016:fix/issue-3333-close-proxy-connection-on-consume-error
Dec 4, 2026
Merged

ok2c merged 1 commit into
apache:masterfrom
Aayush10016:fix/issue-3333-close-proxy-connection-on-consume-error

Conversation

@Aayush10016

@Aayush10016 Aayush10016 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Ensure ProxyClient.tunnel() closes its connection when consuming a refused CONNECT response throws.
  • Add a regression test with a streaming error entity whose content close fails; verify the original IOException is propagated and the connection is closed.

Fixes #3333.

Verification

  • Existing TestProxyClient: 2 tests passed before the change.
  • New test failed before the production fix because ManagedHttpClientConnection.close() was not invoked.
  • Focused TestProxyClient: 3 tests passed after the fix.
  • Full httpclient5 module test lane: 1,249 tests passed, no failures, errors or skips (mvn -B -ntp -Dmaven.repo.local=../cache/m2 -pl httpclient5 -am test, Java 17).
  • Full 10-module Maven reactor: mvn -B -ntp -Dmaven.repo.local=../cache/m2 test passed on a repeat run. The first full-reactor attempt had one intermittent failure in the unrelated MultihomeIOSessionRequesterTest scheduling assertion; that class passed 16/16 in isolation and 16/16 in the passing reactor run.
  • git diff --check passed. The Maven lifecycle ran the configured checkstyle audit.

AI assistance was used to draft and review this change. The reported test outcomes were verified locally.

@Aayush10016
Aayush10016 marked this pull request as ready for review December 4, 2026 05:36
@ok2c
ok2c merged commit ba37c09 into apache:master Dec 4, 2026
20 of 21 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.

ProxyClient.tunnel can skip connection cleanup while consuming an error response

2 participants