Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use the control frame queue for stream-related frames #4271

Open
marten-seemann opened this issue Jan 26, 2024 · 0 comments
Open

don't use the control frame queue for stream-related frames #4271

marten-seemann opened this issue Jan 26, 2024 · 0 comments
Milestone

Comments

@marten-seemann
Copy link
Member

Stream-related frames (MAX_STREAM_DATA, RESET_STREAM, STOP_SENDING, STREAM_BLOCKED) could be enqueued with their respective stream instead of using the control frame queue. The control frame queue is an incredibly mindless tool: It doesn't remember any context of the frames, it just queues and dequeues them, oblivious to what's happening around.

Queueing the frames at their respective stream would allow us to optimize frame handling, e.g.:

  • send out a fresh MAX_STREAM_DATA frame (i.e. with an updated offset) if one is lost
  • not send out a MAX_STREAM_DATA frame if there are still a few (>= 2 maybe) in flight
  • not send out control frames if the stream state changed (e.g. there's no need to send a STREAM_BLOCKED frame if the peer sent us a STOP_SENDING)
  • (de-) prioritize sending of control frames for certain streams (this probably is a terrible idea)

It would also allow us to delay garbage collecting of the stream until all relevant control frames for that stream have been acknowledged. To be clear, we can garbage collect the stream if there are still MAX_STREAM_DATA frames outstanding, and we would now know that losing these frames would be a no-op.

@marten-seemann marten-seemann added this to the v0.44 milestone Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant