Skip to content

h2: RFC 9218 incremental flag unused in priority scheduling #1217

Closed

Description

@FlorentinDUBOIS

Summary

The Prioriser struct in lib/src/protocol/mux/h2.rs stores per-stream (urgency, incremental) tuples per RFC 9218, but the incremental flag is discarded during stream scheduling in write_streams():

priorities.sort_by(|a, b| {
    let (ua, _) = self.prioriser.get(a);  // incremental ignored
    let (ub, _) = self.prioriser.get(b);
    ua.cmp(&ub).then_with(|| a.cmp(b))
});

Per RFC 9218 §4, incremental=true streams within the same urgency level should use round-robin scheduling, while incremental=false streams should be served sequentially (complete one before starting the next).

Current behavior

All streams within the same urgency level are served in stream-ID order (FIFO), regardless of the incremental flag.

Expected behavior

  • incremental=false (default): serve streams sequentially within urgency level
  • incremental=true: interleave DATA frames across streams within urgency level

Priority

Low — urgency-based ordering already provides meaningful prioritization for the common case.


Update — 2026-04-24

Resolved on feat/h2-mux (PR #1209). The scheduler now honours incremental within an urgency bucket (round-robin for i=true, sequential for i=false), with PRIORITY_UPDATE re-ordering and edge-triggered write rearm:

  • 7ddf1f30 feat(h2): parse and honour RFC 9218 §7.1 PRIORITY_UPDATE frames
  • 3f9f5e38 fix(h2): scope incremental_peer_count to same urgency bucket + ready peers
  • 3269dd06 fix(h2): rearm WRITABLE after PRIORITY_UPDATE mutates scheduler state
  • f6c02912 fix(h2): skip RFC 9218 incremental yield for solo-bucket streams
  • 8d226b88 fix(h2): suppress incremental yield between last DATA and closing flags
  • 1de3faad perf(h2): keep per-bucket incremental count consistent mid-pass
  • 465fb108 test(e2e): RED-state test for solo RFC 9218 incremental H2 stream stall
  • 5e523ac0 test(e2e): H2 body-stall repro — mixed-urgency incremental + HAR shape
  • 40c9c2af test(e2e): un-ignore H2 priority-rearm tests with real implementations

E2E coverage includes solo-bucket streams, mixed-urgency incremental bodies, and PRIORITY_UPDATE-driven rearm under edge-triggered epoll. New metrics h2.signal.writable.rearmed.* and the h2.streams.ready_incremental.by_urgency gauge (documented in doc/configure.md) expose the scheduler’s rearm path.

Suggest closing on merge of #1209.

Activity

  1. added 2 commits that reference this issue on Apr 22, 2026
    fe528e7
    0a98e03
  2. added a commit that references this issue on Aug 10, 2026
    d888929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions