quic: align stream priority with W3C WebTransport sendOrder - #64454
quic: align stream priority with W3C WebTransport sendOrder#64454SparshGarg999 wants to merge 1 commit into
Conversation
|
Review requested:
|
14e724b to
7d3c9c1
Compare
|
@SparshGarg999 |
|
Reopening to address the feedback properly. I'll fix the sendOrder range issue (it should accept any integer, not just [0,7]) and note sendGroups as a follow-up that requires upstream ngtcp2 support. |
7d3c9c1 to
2003bae
Compare
|
Hi! I've updated the implementation to address your feedback:
|
There was a problem hiding this comment.
In the QUIC Team call we've discussed prioritization a bit and I think we're going to back off, at least for now, having a prioritization API on the QuicStream level. Once we've completed separating out the Http3Stream API that will allow setting priority via header.
The main motivation for holding off for now is that we need to take some time to figure out what exactly the correct API for prioritization should be given that there are a couple of different models currently at play.
So for now, going to mark this as "Request changes" but we'll be coming back to this.
/cc @nodejs/quic
Adds the numeric sendOrder option to createBidirectionalStream, createUnidirectionalStream, and setPriority, aligning with the W3C WebTransport sendOrder concept where a lower value indicates a higher priority. This maps directly to the raw QUIC stream urgency value (an integer in the range [0, 7]). Additionally, the priority getter is updated to return sendOrder`nrepresenting the current raw QUIC stream urgency value. Fixes: nodejs#63654 Signed-off-by: SparshGarg999 <sparshgarg999@gmail.com>
2003bae to
dd90396
Compare
|
Thanks for the update and clarification, @jasnell! That makes complete sense. Backing off stream-level prioritization until In the meantime, I have rebased this branch onto the latest |
Summary
Align the experimental QUIC stream prioritization options with W3C WebTransport priority semantics by adding the numeric
sendOrderoption.Description
Currently, Node's experimental QUIC implementation supports a string-based priority level ('high', 'default', 'low'). However, the W3C WebTransport specification defines stream priority using a grouped
sendGroupand a numericsendOrderproperty (where lower values represent higher priority/urgency).To align Node's QUIC stream priority API with WebTransport's semantics, this commit introduces the numeric
sendOrderoption.sendOrdermaps directly to the underlying raw QUIC stream urgency value (an integer in the range[0, 7]).sendOrderis specified at stream creation (viacreateBidirectionalStreamorcreateUnidirectionalStream) or viasetPriority(), it overrides/takes precedence over the string-basedprioritylevel.prioritygetter is updated to returnsendOrderalongsidelevelandincrementalproperties, exposing the exact urgency level of the stream.sendOrderis an integer in the range[0, 7]and throws appropriate errors (ERR_OUT_OF_RANGE/ERR_INVALID_ARG_TYPE) for invalid inputs.Verification
Updated
test/parallel/test-quic-h3-priority.mjsto:sendOrdervalue returned in theprioritygetter matches the priority level or explicitsendOrdervalue set.sendOrderat stream creation time.sendOrderviasetPriority().sendOrdertypes and out-of-range values.Fixes: #63654