8000 fix(tool-cache): enable keepAlive for HTTP client to improve download reliability by v1sion · Pull Request #2096 · actions/toolkit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(tool-c 8000 ache): enable keepAlive for HTTP client to improve download reliability #2096

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

v1sion
Copy link
@v1sion v1sion commented Jun 20, 2025 940A

This PR updates the httpm.HttpClient initialization in the tool-cache package to explicitly set keepAlive: true when downloading tools.

The HTTP client is being created without specifying the keepAlive option, which defaults to false.

https://github.com/actions/toolkit/blob/main/packages/http-client/src/index.ts#L142
https://github.com/actions/toolkit/blob/main/packages/http-client/src/index.ts#L172

This causes the client to open a new TCP connection for every request and close it immediately after. In some environments, especially those involving network proxies or service meshes, this pattern can lead to unreliable downloads, connection resets, or timeouts, as these systems often expect clients to reuse connections.

Eg:
Screenshot 2025-06-20 at 09 50 37

By setting keepAlive: true, the HTTP client will reuse TCP connections for multiple requests.

@v1sion v1sion requested a review from a team as a code owner June 20, 2025 12:24
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
0