Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send CONNECT first when recovering a HTTPS request #2077

Conversation

jasonjoo2010
Copy link
Contributor

Issue description

AHC has retry mechanism enabled with up to 5 attempts by default. But the initial CONNECT is omitted when recovering the HTTPS requests with IO exceptions. This MR fixes this issue and guarantees the proper workflow in retries.

It's related to #2071 and fixes a different failing case.

How the issue is fixed

  • For any new connections, make sure there is an initial CONNECT for WebSocket/HTTPS request.
  • For the condition check that a CONNECT has been sent, make sure the connection the current future attaches is reusable/active.

Unit test

IOException has various reasons but in the unit test, we emulate it by closing the connection after receiving the CONNECT request. The internal recovery process will retry another 4 times, and through an IOException eventually.

@hyperxpro hyperxpro merged commit a9a3a7e into AsyncHttpClient:main Mar 14, 2025
3 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.

2 participants