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

http: responseKeepAlive incorrect usage of finished? #28701

Closed
ronag opened this issue Jul 15, 2019 · 3 comments
Closed

http: responseKeepAlive incorrect usage of finished? #28701

ronag opened this issue Jul 15, 2019 · 3 comments

Comments

@ronag
Copy link
Member

ronag commented Jul 15, 2019

Having a hard time to wrap my head around this one. But this looks like a potential bug:

https://github.com/nodejs/node/blob/master/lib/_http_client.js#L621

It seems to assume that if req.finished is true then prefinish has been emitted (or all data has been flushed) and frees the socket for re-use even though more data might be written to it. req.finished just means that end() has been called, not that no more data is going to be written to the socket.

I'm not sure if this is actually a problem. Haven't been able to create any sensible repo case that fails. But it looks very suspect...

@ronag
Copy link
Member Author

ronag commented Jul 15, 2019

@benjamingr Who can I ping on this one? It's a rather tricky one...

@ronag
Copy link
Member Author

ronag commented Jul 15, 2019

Although confusing this is probably fine. responseOnEnd is only called if a socket has been assigned and if a socket is assigned then all data is directly passed to the socket.

@ronag ronag closed this as completed Jul 15, 2019
@ronag
Copy link
Member Author

ronag commented Jul 15, 2019

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

No branches or pull requests

1 participant