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

Remove connectionErrorHandler to fix #1903 #2240

Merged

Conversation

zarenner
Copy link
Contributor

@zarenner zarenner commented Jun 10, 2016

The "socket._httpMessage.emit('error', error)" line currently throws when the keep-alive period expires and the socket resets, after a redirect to a different host. This is because the listener on the socket is never cleaned up, and the socket no longer has _httpMessage (the ClientRequest is long gone). This is bug #1903, which is also responsible for npm/npm#9984.

It looks to me like node core correctly re-emits socket error events on _httpMessage now, so we shouldn't have to. Looking at core I also cannot even find a "res" property on socket - if there's a reason to leave this, please speak up.

Closes #1903

@zarenner
Copy link
Contributor Author

@mikeal @simov any thoughts on this? Thanks.

@brphelps
Copy link

@mikeal @simov Piling on here as this blows up NPM in our CI builds :).

@simov
Copy link
Member

simov commented Jul 8, 2016

Thanks, @zarenner, that doesn't seems to be covered by our tests so I can't tell what the initial goal of this code was.

@zarenner can you confirm that this PR fixes the issue for you?

@zarenner
Copy link
Contributor Author

zarenner commented Jul 8, 2016

@simov This PR fixes the simple repro I posted in #1903 (comment), which I believe to be representative of the real-world cases people are hitting (e.g. failures in npm).

@simov simov merged commit 290111d into request:master Jul 9, 2016
@simov
Copy link
Member

simov commented Jul 9, 2016

Version 2.73 is published with the fix.

@zarenner zarenner deleted the users/zarenner/removeConnectionErrorHandler branch November 15, 2016 17:46
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.

None yet

3 participants