jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Stream cancellation is never called on QpackDecoder/QpackEncoder

Open lachlan-roberts opened this issue 2 years ago • 4 comments

Description

QpackDecoder and QpackEncoder have a streamCancellation(long streamId) method to notify them in case a HTTP/3 stream is cancelled. On the decoder this sends an instruction to the remote encoder, but on the encoder it sends no instruction and just cleans up some local state.

These methods are currently unused and never called by the Jetty HTTP/3 implementation.

lachlan-roberts avatar Mar 01 '22 02:03 lachlan-roberts

@sbordet This seems to be the problematic situation.

  1. The encoder sends EncodedFieldSection with non-zero required insert count.
  2. Reading is abandoned before this EncodedFieldSection is received.
  3. The decoder will never acknowledge that encoded section because it never receives it.

So any references taken by the encoder to send the EncodedFieldSection will never be released as no SectionAcknowledgement is received. So for each EncodedFieldSection sent from the encoder there really does need to be either a SectionAcknowledgement or a StreamCancellation instruction sent from the decoder.

When an endpoint receives a stream reset before the end of a stream
or before all encoded field sections are processed on that stream, or
when it abandons reading of a stream, it generates a Stream
Cancellation instruction; see [Section 4.4.2]. This signals to the
encoder that all references to the dynamic table on that stream are
no longer outstanding.

...
The Section Acknowledgment and Stream Cancellation instructions
permit the encoder to remove references to entries in the dynamic
table. 

lachlan-roberts avatar Mar 30 '22 22:03 lachlan-roberts

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 31 '23 00:03 github-actions[bot]

@sbordet do you know where we can receive the HTTP/3 stream cancellation notification so we can call QPACK.

lachlan-roberts avatar Mar 31 '23 02:03 lachlan-roberts

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 01 '24 00:04 github-actions[bot]