Skip to content

feat(noq-proto): deprecate send_fairness and remove unfair scheduling - #835

Merged
matheus23 merged 1 commit into
mainfrom
matheus23/deprecate-send-fairness
Oct 22, 2026
Merged

matheus23 merged 1 commit into
mainfrom
matheus23/deprecate-send-fairness

Conversation

@matheus23

Copy link
Copy Markdown
Member

Description

Always schedule equal-priority streams round-robin, removing continuation handling before introducing stream affinity. Keep the setter as a deprecated no-op for source compatibility.

API Changes

  • noq::TransportConfig::send_fairness is now deprecated.

Notes & open questions

We might want to wait for #833 before we release with this PR, so we can have an alternative to link to in deprecation documentation (the incremental=false setting).

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All API changes documented.
  • cargo make passes locally.

@matheus23 matheus23 self-assigned this Oct 12, 2026
@matheus23
matheus23 force-pushed the matheus23/deprecate-send-fairness branch from d99cef5 to 1438f7f Compare October 12, 2026 09:06
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/835/docs/noq/

Last updated: 2026-10-21T14:12:56Z

@n0bot n0bot Bot added this to iroh Oct 12, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Oct 12, 2026
@flub

flub commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Isn't send fairness false the same as a single group with incremental=false in #833 ?

I'm kind of in favour of this, but am a little worried about treating this as a feature rather than a breaking change. I'm happy to deprecate it. I'm also happy to say that it doesn't do anything if you also use a stream affinity API once it's deprecated. I'm also happy to replace it with "create a single group with incremental=false" once #833 exists. But changing it to simply be a no-op is pushing the limits of backwards compatibility a little and I need to have some more time getting used to that idea.

@matheus23

Copy link
Copy Markdown
Member Author

Isn't send fairness false the same as a single group with incremental=false in #833 ?

Yeah I think incremental=false will cover any use case that send_fairness(false) had.

am a little worried about treating this as a feature rather than a breaking change

Is this about the PR title? Not sure what else is correct here, given this is a minor-level semver bump?

@flub

flub commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

am a little worried about treating this as a feature rather than a breaking change

Is this about the PR title? Not sure what else is correct here, given this is a minor-level semver bump?

This is about the implementation. E.g. if #833 is implemented the implementation of send_fainess=false can become "configure a single group with incremental=false". But right now it turns into a no-op. Is that really simply "a new feature" for semver purposes, or is this really a breaking change since something that was possible, no longer is.

danielpetri1 added a commit to danielpetri1/noq that referenced this pull request Oct 15, 2026
calex794 added a commit to calex794/noq that referenced this pull request Oct 18, 2026
calex794 added a commit to calex794/noq that referenced this pull request Oct 18, 2026
calex794 added a commit to calex794/noq that referenced this pull request Oct 18, 2026
calex794 added a commit to calex794/noq that referenced this pull request Oct 18, 2026
calex794 added a commit to calex794/noq that referenced this pull request Oct 18, 2026
…to own n0-computer#835 baseline

Preserve fork-specific congestion check, datagram scheduling, alloc/core paths, and existing timer APIs. Include tests for Any, Sticky and Block. Experimental only; no production integration.

@flub flub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having a really hard time approving this because I do think this is taking the mickey out of API stability. But we seem to be stuck at this so yolo I guess.

@flub
flub added this pull request to stack #854 October 21, 2026 12:26
@flub
flub force-pushed the matheus23/deprecate-send-fairness branch from 1438f7f to 8cfde5e Compare October 21, 2026 12:28
scheduling

Always schedule equal-priority streams round-robin, removing
continuation handling before introducing stream affinity. Keep the
setter as a deprecated no-op for source compatibility.
@matheus23
matheus23 force-pushed the matheus23/deprecate-send-fairness branch from 8cfde5e to b0f0f8e Compare October 21, 2026 14:10
@matheus23
matheus23 added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit a78daf8 Oct 22, 2026
33 of 34 checks passed
@matheus23
matheus23 deleted the matheus23/deprecate-send-fairness branch October 22, 2026 09:18
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Oct 22, 2026
@flub flub mentioned this pull request Oct 22, 2026
5 tasks done
Stanley00 pushed a commit to stanley-fork/noq that referenced this pull request Oct 23, 2026
…uter#836)

## Description

Implements setting a stream's affinity to being sent on paths. See the
doc comment on `SendStream::set_affinity` for more information.

This is implemented via keeping multiple `PendingStreamsQueue`s instead
of just one: One queue for each possible affinity, except
`StreamAffinity::Block`, which doesn't need a queue.

On sending in each path, we first check the `any` queue, and then
compare it with pending streams that are pinned to our path.
Between these we compare which one is supposed to go first and use that.

When a stream changes affinity, we need to potentially move it between
queues.

If a stream goes from blocked to another affinity, we don't restore its
recency, instead, we give it a new one. This is as if the data the
stream had queued were submitted just when switching. This is to avoid a
situation in which someone suddenly unblocks a lot of small streams
after a long time of being blocked and these streams suddenly jumping
the queue and starving out other streams.

## API Changes

- Adds `noq_proto::StreamAffinity`
- Adds `noq_proto::SendStream::set_affinity`

## Notes & open questions

- Plan is to also add APIs for noq, but not in this PR
- This is stacked on top of n0-computer#835 because that simplifies this
implementation.
- This somewhat conflicts with n0-computer#859 but the conflicts are reconcilable.
- I'm using `PendingQueueMut` as an abstraction to ensure we don't
accidentally leave empty `PendingStreamsQueue`s around for sticky paths
that don't exist anymore.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All API changes documented.
- [x] `cargo make` passes locally.

---------

Co-authored-by: Floris Bruynooghe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants