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

[rush-lib] Fix issue with MaxListenersExceeded while using the HTTP build cache plugin #5073

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

D4N14L
Copy link
Member

@D4N14L D4N14L commented Jan 9, 2025

Summary

Removes unnecessary error handling when dealing with ECONNRESET-like errors. Fixes #5061.

Details

An error handler was added to the socket to deal with ECONNRESET and other ECONN* errors that seemingly wouldn't bubble up. These errors were difficult to validate the fix against, so minimal testing of the change was done. However, errors began to arrise due to socket reuse in the http/https libraries during periods of high request utilization against the same host, leading to too many error handlers being added to individual sockets.

This change removes the socket handler, as we validated by looking at Node source code that socket errors should bubble up to the request error handler. See: https://github.com/nodejs/node/blob/14b6317641751590ebe5d87d4f15822ae3fdb7d6/lib/_http_client.js#L497

How it was tested

Locally calling the HTTP library and confirming that easy-to-reproduce ECONN* errors would bubble up to the request error handler.

Impacted documentation

N/A

@D4N14L D4N14L changed the title User/danade/remove socket error handler [rush-lib] Fix issue with MaxListenersExceeded while using the HTTP build cache plugin Jan 9, 2025
@D4N14L D4N14L merged commit e5560f2 into microsoft:main Jan 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

[rush] MaxListenersExceeded when trying to bump to Rush v5.147.1
2 participants