cloudflare / cloudflare/quiche

`stream_writable` for new streams

Open
#2,241 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
11.8k
Forks
1.1k
Avg merge
3d 7h
Merged PRs (30d)
16

Description

I created a wrapper around each stream that calls `stream_writable` before `stream_send`. The idea is that this would queue up `stream_writable_next` if false. Unfortunately this doesn't work for new streams, as `stream_writable` returns `InvalidStreamState` if the stream has not been created yet.

This feels counter-intuitive because the `stream_send` will succeed; the stream is in fact writable. I think it would be useful behavior because it removes the guess-work for `peer_streams_left`. The new stream would only be marked writable (createable) when MAX_STREAMS flow control allows it.

My workaround is to call `stream_send(id, &[], false)` first to create the empty stream first. In hind-sight, I should really just try calling `stream_send` first and `stream_writable` only when it performs an incomplete write, but it would still be useful for MAX_STREAMS.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the stream_writable and stream_send entry points for streams that have not yet been created, focusing on MAX_STREAMS flow control and the InvalidStreamState result. Compare the proposed writable/createable behavior with stream_writable_next and verify that existing stream_send behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.