You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix leaked socket after HTTP download timeout - #1292
Fix a socket leak in @actions/http-client timeout handling.
The existing timeout callback calls socket.end(), which can leave a half-open client socket alive when the remote peer keeps its side of the connection open. That keeps the Node.js event loop active after the action’s work has completed.
This change patches the dependency during build and test setup to destroy the timed-out request with the timeout error instead. The patch is idempotent and fails fast if the expected upstream dependency implementation changes.
The compiled dist/ bundles have been regenerated.
This patch was developed with assistance from GPT-5.6-Sol.
Related issue
N/A
Check list
Ran npm run check locally (format, lint, build, test) and all checks pass.
Documentation changes are not required.
Added a regression test using a half-open TCP server to verify no client socket remains active after timeout.
Thanks for the fix and the regression test, @dajudge. The underlying timeout/socket lifecycle bug is in @actions/http-client, which now lives in the actions/toolkit repository under packages/http-client: https://github.com/actions/toolkit/tree/main/packages/http-client. Please submit the patch and regression test there instead. Fixing it upstream will benefit all consumers and avoid maintaining a dependency-patching script in setup-java. Once an upstream release includes the fix, setup-java can update the dependency. Closing this PR in favor of that upstream fix.
Do you happen to know who currently maintains actions/toolkit, or the best person/team to request a review from there?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix a socket leak in
@actions/http-clienttimeout handling.The existing timeout callback calls
socket.end(), which can leave a half-open client socket alive when the remote peer keeps its side of the connection open. That keeps the Node.js event loop active after the action’s work has completed.This change patches the dependency during build and test setup to destroy the timed-out request with the timeout error instead. The patch is idempotent and fails fast if the expected upstream dependency implementation changes.
The compiled
dist/bundles have been regenerated.Related issue
N/A
Check list
npm run checklocally (format, lint, build, test) and all checks pass.