-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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_client: ensure empty socket on error #1103
Conversation
Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: nodejs/node-v0.x-archive#9348
I'll hold up 1.5.1 for this |
oh, that was a lgtm from me |
@rvagg thanks! This seems to be pretty sensitive piece of code, would anyone from @iojs/collaborators like to take a look at it too and give it additional LGTY? |
@rvagg erm, language is my enemy :) I didn't meant to offend you in any way, just would like to have two LGTYs on this. |
heh, no offense taken at all! I'm keen for more eyes too, mine aren't tuned to this section of code |
LGTM! the only thing I would like to mention is to leave the declaration of the |
@micnic : why? It might disappear after |
Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: nodejs/node-v0.x-archive#9348 PR-URL: #1103 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]>
Landed in 1a3ca82, thank you! |
@rvagg : guess we are good to go for 1.5.1 now. There is a remaining TLS leak that I'll investigate soon, but do not let it block the release for a significant time. |
@rvagg : I mean - we already fixed most of it, only minor problem is left. |
@indutny, I mentioned that for the sake of "variable declaration first in function body" code style. Could you show me, please, where exactly may the parser change in |
@micnic this is not about |
Thanks, I was a bit confused, I'll investigate more to understand better how the things work under the hood. |
is this an 0.12 & io.js thing only or does it also go to 0.10? |
Notable changes: * tls: The reported TLS memory leak has been at least partially resolved via various commits in this release. Current testing indicated that there may still be some leak problems. Progress being tracked at: #1075 * http: Fixed an error reported at nodejs/node-v0.x-archive#9348 and npm/npm#7349 Pending data was not being fully read upon an 'error' event leading to an assertion failure on socket.destroy(). (Fedor Indutny) #1103
Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: nodejs#9348 PR-URL: nodejs/node#1103 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]>
This change is a backport of 1a3ca82 from io.js. Original commit message: Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: nodejs#9348 PR-URL: nodejs/node#1103 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Fixes nodejs#9348.
This change is a backport of 1a3ca82 from io.js. Original commit message: Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: nodejs#9348 PR-URL: nodejs/node#1103 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Fixes nodejs#9348.
This change is a backport of 1a3ca82 from io.js. Original commit message: Read all pending data out of the socket on `error` event and ensure that no `data`/`end` handlers will be invoked on `socket.destroy()`. Otherwise following assertion happens: AssertionError: null == true at TLSSocket.socketOnData (_http_client.js:308:3) at TLSSocket.emit (events.js:107:17) at TLSSocket.Readable.read (_stream_readable.js:373:10) at TLSSocket.socketCloseListener (_http_client.js:229:10) at TLSSocket.emit (events.js:129:20) at TCP.close (net.js:476:12) Fix: #9348 PR-URL: nodejs/node#1103 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Fixes #9348. Reviewed-By: Julien Gilli <[email protected]> PR-URL: #14087
Read all pending data out of the socket on
error
event and ensure thatno
data
/end
handlers will be invoked onsocket.destroy()
.Otherwise following assertion happens:
Fix: nodejs/node-v0.x-archive#9348
See: npm/npm#7349
cc @iojs/collaborators @bnoordhuis @othiym23