Skip to content

feat(racer): add standalone flow-control library - #865

Open
Jordan Olshevski (jveski) wants to merge 49 commits into
pr/racer-allocfrom
pr/racer-flow
Open

Jordan Olshevski (jveski) wants to merge 49 commits into
pr/racer-allocfrom
pr/racer-flow

Conversation

@jveski

@jveski Jordan Olshevski (jveski) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds a standalone flow-control library for charged allocation, policy-driven admission, coalescing, and bounded pipes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Reentrant callbacks can deadlock quota paths, and rejected zero-waiter joins leak active cohort capacity.

Review effort: Balanced
Findings: 3 High severity · 2 Medium severity

Open (5)
What changed in this PR

Adds a standalone flow-control crate to the racer dataplane workspace.

Changes:

  • Implements quotas, charged buffers, bounded pipes, and credit windows.
  • Adds adaptive admission, handoffs, hedging, and request coalescing.
  • Adds comprehensive tests, documentation, and CI coverage.
File Description
.github/​workflows/​ci.yaml Adds production and simulation validation.
cmd/​racer-dataplane/​README.md Documents flow-control usage and testing.
cmd/​racer-dataplane/​Cargo.lock Locks the new crate dependencies.
cmd/​racer-dataplane/​Cargo.toml Registers the workspace member.
cmd/​racer-dataplane/​flow/​.gitignore Ignores local build output.
cmd/​racer-dataplane/​flow/​Cargo.toml Defines the crate and dependencies.
cmd/​racer-dataplane/​flow/​src/​admission.rs Implements admission and handoff mechanisms.
cmd/​racer-dataplane/​flow/​src/​coalesce.rs Implements keyed coalescing and flight tracking.
cmd/​racer-dataplane/​flow/​src/​lib.rs Implements quotas, buffers, and credit windows.
cmd/​racer-dataplane/​flow/​src/​pipe.rs Implements bounded reusable kernel pipes.
cmd/​racer-dataplane/​flow/​tests/​workflows.rs Tests public ownership and lifecycle contracts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/racer-dataplane/flow/src/admission.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/lib.rs
Comment thread cmd/racer-dataplane/flow/src/lib.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs
Comment thread cmd/racer-dataplane/flow/src/lib.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread cmd/racer-dataplane/flow/src/admission.rs
Comment thread cmd/racer-dataplane/flow/src/lib.rs
Comment thread cmd/racer-dataplane/flow/src/admission.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/lib.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread cmd/racer-dataplane/flow/src/admission.rs
Comment thread cmd/racer-dataplane/flow/src/admission.rs
Comment thread cmd/racer-dataplane/flow/src/admission.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/pipe.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Reentrant key and waker callbacks can currently replace active work or execute while owner locks remain held.

3 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread cmd/racer-dataplane/flow/src/admission.rs
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated
Comment thread cmd/racer-dataplane/flow/src/coalesce.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Key-clone reentrancy can panic, and stopped pools retain inaccessible idle pipe resources.

1 open finding
3 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Stopping without draining idle pipes leaks cached descriptors and charges

cmd/​racer-dataplane/​flow/​src/​pipe.rs:247

Checking stop before touching idle strands every pipe cached before Quotas::stop(): the quota authority cannot clear this pool, and all later acquisitions return here, so those descriptors and pipe-class charges remain live until the entire PipePool is dropped. Add a pool shutdown/stop path that drains the idle cache (and use it when stop is observed), matching the existing rule that leases dropped after stop are not recycled.

🧠 Review effort: Balanced

Comment thread cmd/racer-dataplane/flow/src/lib.rs Outdated
@jveski
Jordan Olshevski (jveski) requested a balanced review from Copilot October 7, 2026 23:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants