| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I think we'd rather want to handle it from JS. We should mark stream as previously consumed and fallback to slow .on('data') case. Does this make sense? |
Sorry, something went wrong.
|
@indutny - Thanks for your response. |
Sorry, something went wrong.
|
@Kasher this C++ API needs some serious renovation and this is a separate question, in my opinion. I suggested to do it in JS, because this bug will still manifest itself if anyone would try to emit('connection', req.connection). Fixing it in JS will make your test case work as well as many other possible variations. |
Sorry, something went wrong.
|
@indutny - Cool. I got it. How should I implement your suggestion? Should I keep the same parser for the socket in _http_server.js, and never free\unconsume it (which means some changes in the function onParserExecuteCommon in _http_server.js)? Thanks a lot!! |
Sorry, something went wrong.
|
@Kasher there is a fallback mode there when it checks for _externalStream: Lines 331 to 335 in a67a04d This won't affect context of callbacks as the attached http parser (if any) will still be alive until unconsume is called. |
Sorry, something went wrong.
|
@indutny Thanks again for your help. My 'connect' handler is being called from the function onParserExecuteCommon in _http_server.js : Line 466 in a67a04d A few lines before my handler is called, there is a call to unconsume on the attached http-parser: Line 453 in a67a04d Hence, when my connect handler is called, there is no http-parser attached to the socket. If I remove the call to consume as you suggested, no parser will be attached at all, and no callbacks will be set to the socket's _externalStream. Do you suggest to remove the call to unconsume as well, so the parser will still be attached? This will result in a refactor in the onParserExecuteCommon method, since I guess we shouldn't execute the following lines as well: Lines 450 to 456 in a67a04d Did I miss something? Thanks a lot, your help is really appreciated!!! |
Sorry, something went wrong.
|
@kosher consume() is just one way to attach socket, the fallback is to attach socketOnData event listener. I suggest that consume() should not be called if the socket was ever previously consumed (even if it is not consumed right now). |
Sorry, something went wrong.
|
@indutny Thanks again. |
Sorry, something went wrong.
There was a problem hiding this comment.
Few style nits, otherwise looks good!
Sorry, something went wrong.
There was a problem hiding this comment.
Minor style nit:
var external = socket._handle._externalStream;
if (!socket._handle._consumed && external) {
...
}Less indent - awesome 😉
Sorry, something went wrong.
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket).
|
Looks like it's ready for a CI: https://ci.nodejs.org/job/node-test-pull-request/6103/ |
Sorry, something went wrong.
|
The linux tester failed for fedora24 - 32bit on the test sequential/test-child-process-pass-fd So, just to verify - is this by any chance a known issue? If it isn't - I'll download the appropriate iso and create a VM to test this. Thanks. |
Sorry, something went wrong.
|
Yeah it's a known issue(#11041), also the arm failure is actually not a failure, it's related to some infra issue so it's actually green in the webpage. I'll say CI is green for this PR. |
Sorry, something went wrong.
|
@joyeecheung Awesome, thanks! |
Sorry, something went wrong.
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: nodejs#11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: nodejs#11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When emitting a 'connection' event on a httpServer, the function connectionListener is called. Then, a new parser is created, and 'consume' method is called on the socket's externalStream. However, if this stream was already consumed and unconsumed, the process crashes with a cpp assert from the 'Consume' method in stream_base.h. This commit makes sure that no SIGABRT will be raised and the process will stay alive (after emitting the socket). PR-URL: #11015 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Node 7 does not include nodejs/node#11015. Without this fix, the process is killed when proxying a connection through HTTPS. We could try to work around this on our end, but node 7 is officially unsupported, and it seems more sensible to simply drop support here entirely too.
| Back | FazBrowse Home | New Git URL |
When emitting a connection event on a httpServer, the function connectionListener is called.
Then, a new parser is created, and consume method is called on the
socket's externalStream. However, if this stream was already consumed and unconsumed,
the process crashes with a cpp assert from the Consume method in
stream_base.h. This commit makes sure that no SIGABRT will be raised
and the process will stay alive (after emitting the socket).
Checklist
Affected core subsystem(s)
src
Issue: #11017