quinn icon indicating copy to clipboard operation
quinn copied to clipboard

Evaluate intrusive lists for stream bookkeeping

Open Ralith opened this issue 4 years ago • 1 comments

We currently maintain a list of stream IDs that may have data to send separately from the list of streams themselves. Removing streams from this list isn't practical since their position is unpredictable. In #1196 this tripped us up as other code assumed a nonempty list guaranteed that a stream could send, even though that stream might have been reset.

Replacing the stream ID list with an intrusive list of streams would allow streams to robustly remove themselves from the list as needed. The same pattern might be applicable to e.g. StreamsState::connection_blocked and maybe even Retransmits::max_stream_data. These are traditionally a difficult data structure in rust due to the ownership/access ambiguity they introduce, but we should review what solutions to that have been developed, if any.

Ralith avatar Nov 03 '21 22:11 Ralith

This could also be nice to easily avoid redundant stream state transition events, which can be confusing (e.g. https://github.com/quinn-rs/quinn/issues/1587).

Ralith avatar Jun 11 '23 23:06 Ralith