-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[Tracking Issue]: Some http2 todos #17746
Comments
Regarding the file/fd handling … I still think these APIs shouldn’t exist. I can see that performance is the reason we have them, but that’s just a failure on Node’s streams API in general, and we shouldn’t have to give up orthogonality as a principle of good API design for that. My current short-term goal (maybe that’s obvious from the PRs I’m opening) is to simplify and increase performance of our
As a heads up, the next piece of that journey is that I’m trying to get rid of |
I'm very happy to see the improvements in StreamBase but I really don't want to lose the |
@jasnell Why? There’s no reason for users to expect them to do anything different than |
if we can get a reasonable fast path with the current pipe model (your second main bullet) then ok. For me, the requirement is not so much the specific API surface as much as it is having the ability to send file purely at the c++ level without pulling any of the chunks into JS. The new streams API work that @Fishrock123 and I have (slowly) been looking at will make this far more efficient once we get down that road further.
Well, yes... (1) data transfer purely at the C++ level, (2) zero buffering, (3) no transforms, (4) no unnecessary C++-to-JS boundary crosses... Using a |
Hi @jasnell, I'm new so I wanted to collaborate on this issue, can you tell me one task to start? |
@bacriom Writing tests is always a great first thing to work on. For HTTP2, here are the coverage reports: https://coverage.nodejs.org/coverage-06033695ed0bfca5/root/internal/http2/index.html — just find an area that has missing coverage and work on tweaking an existing test or creating a new one. Or outside of HTTP2, check out issues labeled as "good first issue." |
@apapirovski thanks! :) |
Hey @jasnell, I am new to this open source community and would like to contribute. Can you help with any task to start over here? I work with node js daily at work. So I can start with javascript as well as C, C++ related code. Thanks! |
@addaleax @jasnell I think we should add an |
@mcollina ... +1 on the |
@kamesh95 ... a fantastic first task would be to look at improving test coverage and documentation. That's a fantastic starting point to begin learning the implementation details and helps us with a piece that is both critically important and definitely underserved at the moment. |
@jasnell Thanks! I will start looking into the existing test cases and their flow to get a better understanding and then start contributing. :) |
PR-URL: #17763 Refs: #17746 Reviewed-By: Matteo Collina <[email protected]>
@jasnell wrote:
@mcollina wrote:
Not exactly one-to-one. For the design of this pool, do keep in mind that HTTP/2 already supports coalescing, and proposals like Alt Svc or Secondary Certs push in the same direction. Note also that head of line blocking under TCP congestion still exists in HTTP/2. Explicitly creating multiple H2 sessions may still be useful. Couple of ideas:
|
@apapirovski hi ! I wrote some coverage tests as you said... and I want to know, can I create a pull request to extend the code coverage ? |
@bacriom You should always feel free to open a PR for any changes you have, you don't need to check with anyone first :) If you need any more info, see our Contributing guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#pull-requests |
We definitely need to support multiple I think the easiest will be to use the |
I would leave http2.connect() as is, and build the pool as a facility on top. I’m very -1 on adding the same behavior of the agent property of http1, because none of the objects are compatible anyway. Developing a compat version for the client is another topic, and not what I had in mind. @apapirovski I wrote both sentences, they look skmilar to me, but it’s definitely not flashed out enough for a full implementation. It does not want to be a spec. We need a pool concept because every time I see an http2 client library, they implemented their own pool: there is some complexity in all the events that they need to listen to and I think it’s something we can implement for good. |
@mcollina I assume you were replying to @sebdeckers? or @addaleax? |
My bad, it was @sebdeckers. |
PR-URL: #17908 Refs: #17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Thinking about the I've opened #17935 to get things rolling. We do not have to wait for |
@jasnell I would leave it open, but with a default for secure things. A non-secure |
Collect and report basic timing information about `Http2Session` and `Http2Stream` instances. PR-URL: #17906 Refs: #17746 Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #17908 Refs: #17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#17908 Refs: nodejs#17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#17908 Refs: nodejs#17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Backport-PR-URL: nodejs#18050 PR-URL: nodejs#17763 Refs: nodejs#17746 Reviewed-By: Matteo Collina <[email protected]>
Collect and report basic timing information about `Http2Session` and `Http2Stream` instances. Backport-PR-URL: nodejs#18050 PR-URL: nodejs#17906 Refs: nodejs#17746 Reviewed-By: Matteo Collina <[email protected]>
Backport-PR-URL: #20456 PR-URL: #17908 Refs: #17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Backport-PR-URL: #18050 Backport-PR-URL: #20456 PR-URL: #17763 Refs: #17746 Reviewed-By: Matteo Collina <[email protected]>
Collect and report basic timing information about `Http2Session` and `Http2Stream` instances. Backport-PR-URL: #18050 Backport-PR-URL: #20456 PR-URL: #17906 Refs: #17746 Reviewed-By: Matteo Collina <[email protected]>
Should this be kept open? Most things got addressed and the rest could probably be dealt with on demand? |
Just note that quite a bit of the missing test coverage in that are for purely defensive branches that should be impossible to get to and would extremely difficult to construct a test for. |
Regarding In many scenarios, you'll want a client that ideally uses We've been discussing in szmarczak/http2-wrapper#6 and sindresorhus/got#167 to use this in https://github.com/sindresorhus/got |
@pietermees We are not really talking about a new module/function capable of doing both HTTP1 and HTTP2, but rather something that allows consumer to not worry about sessions, easily handle handle reconnects (there is an upper limit to the number of streams that can be created over a session) and maybe support some basic connection pooling. This is a basic piece of software to enable some work in the ecosystem. Specifically our If we want to support a similar API, a good starting point could be to add |
Yeah, sure. |
Closing this. The remaining items can be handled individually if someone wishes to pursue them |
Finally I got the time to release
that'd be great! I'll try to send a PR once |
@szmarczak added comments to both issues :) |
@pietermees Replied back. |
|
Hello @nodejs/http2 folks... now that the big destroy/cleanup refactor is finally done, there are a number of remaining items that need working on with an eye towards bringing http2 out of experimental in time for Node.js 10.0.0. We can use this tracking issue to keep organized.
Please leave a comment in the thread if you wish to take on one of the items. I've added a comment on the ones I'm definitely working on.
PR: http2: convert Http2Settings to an AsyncWrap #17763 -- Convert
Http2Settings
into an Async handle object following the same pattern asHttp2Ping
(c++ and javascript). Currently, there is no async context tracking between sendingSETTINGS
and receiving the acknowledgement back. What I'd like to do is add a callback argument toHttp2Session.prototype.settings()
and turn thenode::http2::Http2Settings
object into an AsyncWrap following the same patternHttp2Ping
uses. There are a couple of complicating points on this:SETTINGS
frame is sent automatically at the start of theHttp2Session
and there is currently no way to pass a callback in for this. Currently alocalSettings
event is emitted on theHttp2Session
when it receives an acknowledgement, which is the only way we currently have for catching these. If someone wants to set a callback for that initialSETTINGS
frame, then they'll need a way of setting it.localSettings
andremoteSettings
events would need to be refactored.respondWithFile()
andrespondWithFD()
should have an associated request handle and callback. Currently the only way to know when these operations are done is to watch of theclose
event on theHttp2Stream
. (c++ and javascript)node::http2::Http2Stream::Provider:FD
currently uses synchronous libuv fs calls to fill in the DATA frame buffer. While these are relatively small reads, it is still blocking file i/o. This bit needs to be refactored to use non-blocking. This will require quite a bit of work and requires quite a bit of C++ know how to get done. (all c++)Performance metrics! Each
Http2Session
should record some basic metrics about the number ofHttp2Stream
s that have been used, the average duration, etc. These could also reasonably emit trace events in a number of places along with some perf_hooks integration. I'll be working on this in the coming few weeks. (mostly c++, some js) http2: perf_hooks integration #17906Reviewing test coverage. Pretty self-explanatory.
Support
unref()
andref()
inHTTP2Session
andHTTP2Stream
http2: implement ref() and unref() on client sessions #16617Add a
http2.Pool
object to maintain a pool of sessions open, one for every target host. This functionality is needed by everyone that wants to use the client. Requires http2: implement ref() and unref() on client sessions #16617 because the pool should automatically ref() and unref() the sessions based on usage. There is no global pool. (will depend largely on origin set support landing - http2: initial support for originSet #17935)Update nghttp2 library dependency (deps: update nghttp2 to 1.29.0 #17908)
Support
ALTSVC
frames http2: add altsvc support #17917Initial origin set support http2: initial support for originSet #17935
Stretch goal: rudimentary support for extension frames.
I'm currently working on the
Http2Settings
and perf metrics items, and will be looking at the extension frames bit later on once everything else is done.The text was updated successfully, but these errors were encountered: