GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — src: quic by jasnell · Pull Request #44325 · nodejs/node Conversation
|
|
I think we should better off in tagging this "dont-land" on all lines. Wdyt? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah likely a good idea |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
To-do list:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'll likely get involved once there is a public API. I'm no internals expert (more of an internals breaker) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5c0053e to
161f525
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I've opened a few small PRs with commits from this PR (or adaptations thereof) in the hope that those can land, potentially making it easier to review this PR.
The first two should be able to land without requiring any changes here. The third will conflict with the commits here and will also require a small change due to an API change in ngtcp2 (see #44622 (comment)). Note that these changes only affect existing code in Node.js and do not add any features. Additions should remain in this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@jasnell how close is this to getting a JS API? I have the possibility of some time that can be allocated in late november / early december where I can do a similar process to the previous pull request on a JS API. Probably finding a few bugs along the way. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Adds an optional third argument to `defineEventHandler()` to specify an event name that is separate from the name used for the property. This will be used, for instance, by the quic implementation to support generating the `on...` events where the event name itself is hyphenated. For instance `defineEventHandler(target, 'streamreset', 'stream-reset')` Separated out from nodejs#44325 Signed-off-by: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
|
PR #45032 replaces commit 9156797 in this PR. Separated out to help continue reducing the size here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tniessen ... smaller now :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm still not done reading through all of it. Like I said, it's taking a lot of time. 😅 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| const opts = { | ||
| ...options, | ||
| depth: options.depth == null ? null : options.depth - 1 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, it might be better to check for NaN here, before arithmetics
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| alpn, | ||
| servername, | ||
| preferredAddressStrategy, | ||
| undefined, // Connection ID Factory, not currently used. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
huh? 🤔
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Alrighty, codebase all LGTM @jasnell you da men 🦾 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've got the ability to run my tests that caught memory leaks last time again once there's a js API. I'm no native expert. I only know enough native js to break things or make small fixes (currently). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I haven't looked at src/quic/crypto.* (1500 lines) at all yet. Maybe someone else has? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I've left some notes about the JS part.
Also, much of the tests seem to not really assert anything and just validate that it doesn't crash. Perhaps in place of a proper public API we could have more in-depth tests as examples of how all this fits together? I assume when a public API is made we could probably delete much of the internal tests, so could also use that to provide code examples with lots of comments explaining the use.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| sendInfoHeaders(headers) { | ||
| if (this.#inner === undefined) | ||
| throw new ERR_INVALID_STATE('The stream has been closed.'); | ||
| this.#inner.sendHEaders(QUIC_HEADERS_KIND_INFO, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| this.#inner.sendHEaders(QUIC_HEADERS_KIND_INFO, | |
| this.#inner.sendHeaders(QUIC_HEADERS_KIND_INFO, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } = options; | ||
| validateBoolean(terminal, 'options.terminal'); | ||
|
|
||
| this.#inner.sendHEaders(QUIC_HEADERS_KIND_INITIAL, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| this.#inner.sendHEaders(QUIC_HEADERS_KIND_INITIAL, | |
| this.#inner.sendHeaders(QUIC_HEADERS_KIND_INITIAL, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| this.#endpoint = endpoint; | ||
| this.#inner[kOwner] = this; | ||
| this.#stats = new SessionStats(this.#inner.stats); | ||
| this.#state = new SessionState(this.#inner.state); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not really a fan of having two so similarly-named things so close together. Very easy to misread/mistype. Might be a good idea to rename one of these. 🤔
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| this.#inner = options[kCreateInstance](); | ||
| this.#inner[kOwner] = this; | ||
| this.#state = new EndpointState(this.#inner.state); | ||
| this.#stats = new EndpointStats(this.#inner.stats); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Again, very similarly named things in the same place is easily misread.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The changes to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have pulled off more of the implementation bits into a separate PR here: #47263 The plan is to keep peeling pieces off into separate smaller PRs as much as possible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Do we know what else is needed here? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Most of my commits are very out of sync with your new work and would require re-testing however the ones highlighted in this review look to be matching with the current source.
There is also some comits related to keeping objects alive that look like they should still apply but would require testing.
We saw lots of crashes if the endpoint was allowed to close while streams were bound etc in the old implementation and generally resolved this by adding references between objects as required (e.g that the outbound source requires its backing packet)
I can go about validating these when theres a JS API I bet.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| pos = nullptr; | ||
|
|
||
| if (++packetSendCount == maxPacketCount) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is this how you plan to deal with the stream blocked = infinite resends?
I did it a different way in my fork. In my fork I ensured that a stream that returned NGTCP2_ERR_STREAM_DATA_BLOCKED would not be requeued within this call (HalleyAssist@a2c6fbe)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| DEBUG_ARGS(session_, "Stream Data: %s", stream_data); | ||
|
|
||
| if (!packet) { | ||
| packet = CreateStreamDataPacket(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This packet needs to retain the outbound source or node may crash
See HalleyAssist@60d9bbc for how I did it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| void Session::SendConnectionClose() { | ||
| CHECK(!NgCallbackScope::InNgCallbackScope(*this)); | ||
|
|
||
| if (is_destroyed() || is_in_draining_period() || state_->silent_close) return; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This fix is the same as I found in HalleyAssist@f505f7a 👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| int DefaultApplication::GetStreamData(StreamData* stream_data) { | ||
| if (stream_queue_.IsEmpty()) return 0; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This short circuit bypasses stream_data->stream.reset(stream);
My notes don't say why but this was an issue.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.