-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Merge streams handling code for http2 streams & net.Socket #19060
Comments
Hello |
@addaleax Are you sure this is a |
@apapirovski Yeah, I would talk with people who volunteer for it in more detail about that :) Then again, this doesn’t really require C++ knowledge, although that’s certainly helpful – it’s only about refactoring the JS, as the C++ parts should be identical between those two systems… I’ve removed the label for now. @inidaname The relevant code is in I think we’d want to create a new file |
@addaleax Okay thank you |
Hi @addaleax : would like to take a shot at this, though would need some beginner help too. For instance, |
@SirR4T Sure! But maybe take a different bit of the code, unless @inidaname says that they aren’t working on it anymore.
Well, the underlying stream isn’t a
The code from For
There’s quite a few common pieces between
|
@SirR4T Are you still interested in this? |
I am, but looks like I may be out of my depth here. Maybe further hints might help? Or I'll try my hand at other issues first. |
@SirR4T I think you could break this down into small pieces, if that helps. And please don’t be shy to approach me with questions if you have any. For example, once discrepancy here is that Lines 778 to 779 in 22b6804
Whereas HTTP/2 uses a plain node/lib/internal/http2/core.js Lines 1679 to 1680 in 22b6804
We should probably change Also, it looks like those lines in the HTTP/2 implementation aren’t covered by our tests: https://coverage.nodejs.org/coverage-0048169f5e6d280f/root/internal/http2/core.js.html Adding a test for them would be a nice change to go along with aligning the implementations, if you feel up for it. |
First steps towards nodejs#19060
Hey @addaleax , I think i got the I would think I should induce a situation where |
Hm – I guess leave it out then first. I thought you could make this fail by breaking the underlying connection before the write, but a) I missed that HTTP/2 streams are still always asynchronous and b) a broken connection would probably destroy the HTTP/2 stream anyway. |
Hey @addaleax ! what should be the next steps here? |
First steps towards #19060 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Squashed from: - lib: separate writev responsibilities from writeGeneric - lib: fix calling of cb twice - lib: extract streamId out of stream_base to caller - lib: add symbols instead of methods to hide impl details - lib: remove unneeded lines - lib: use Object.assign instead of apply - lib: rename mixin StreamBase to StreamSharedMethods - lib: use stream shared funcs as top level instead of properties of prototypes - lib: mv lib/internal/stream_shared_methods.js lib/internal/stream_base_commons.js - lib: add comment for readability - lib: refactor _writev in Http2Stream - lib: rephrase comment - lib: revert usage of const,let for perf reasons PR-URL: #19527 Refs: #19060 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Merge error handling for `net.Socket`s and `Http2Stream`s, and align the callback property names as `callback`. Refs: nodejs#19060
First steps towards #19060 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Squashed from: - lib: separate writev responsibilities from writeGeneric - lib: fix calling of cb twice - lib: extract streamId out of stream_base to caller - lib: add symbols instead of methods to hide impl details - lib: remove unneeded lines - lib: use Object.assign instead of apply - lib: rename mixin StreamBase to StreamSharedMethods - lib: use stream shared funcs as top level instead of properties of prototypes - lib: mv lib/internal/stream_shared_methods.js lib/internal/stream_base_commons.js - lib: add comment for readability - lib: refactor _writev in Http2Stream - lib: rephrase comment - lib: revert usage of const,let for perf reasons PR-URL: nodejs#19527 Refs: nodejs#19060 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Merge error handling for `net.Socket`s and `Http2Stream`s, and align the callback property names as `callback`. Refs: nodejs#19060 PR-URL: nodejs#19734 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
First steps towards nodejs#19060 PR-URL: nodejs#19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
First steps towards #19060 Backport-PR-URL: #20456 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
First steps towards #19060 Backport-PR-URL: #20456 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
First steps towards #19060 Backport-PR-URL: #20456 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Hi @addaleax , I was just taking a second look at the |
Ping @addaleax ... any progress here? |
Seems like we had some decent progress here. Not sure there's a ton more we can easily do. I'm going to close out for now but feel free to reopen if you believe I've made a mistake. |
Yeah, I don’t think we’re even halfway where I want to be. 😄 I’ll work more on this bit in the near future. |
PR-URL: #24380 Refs: #19060 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
PR-URL: #24380 Refs: #19060 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
@addaleax I would like to give it a shot as well 👍 |
PR-URL: #24380 Refs: #19060 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
@addaleax is help needed in closing this issue? |
PR-URL: nodejs#24380 Refs: nodejs#19060 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
PR-URL: #25084 Refs: #19060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #25084 Refs: #19060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
If there are any outstanding parts you want merged together I'd like to try it out too! |
I would love to help out as well; I'm comfortable working on both C++ and JS parts. |
@ronag I guess you might be interested in this. |
I am interested as well..!!
Please let me know if i can
…On Sat, 4 Jan, 2020, 08:20 Ruben Bridgewater, ***@***.***> wrote:
@ronag <https://github.com/ronag> I guess you might be interested in this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19060?email_source=notifications&email_token=AAUACRYDUBWBLEYRTLAJ663Q372OPA5CNFSM4ES3BJN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEICPLWY#issuecomment-570750427>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUACR3X4Q3RK7NJTMLJXFTQ372OPANCNFSM4ES3BJNQ>
.
|
Hey :)
It would be great if we could unify all the code from
net
andhttp2
that is only concerned with pushing data to/from the underlying stream, ideally into a common base class ofnet.Socket
andHttp2Stream
, so that we could also maybe port some of the other native streams (zlib, fs) to usingStreamBase
on the native side & generally just share a lot of code.This is probably not an easy task, and probably not doable in one pass, because the http2 and net implementations are always just slightly different, but if anybody wants to try to start working on this, feel free to reach out by commenting here.
The text was updated successfully, but these errors were encountered: