docs(design): multi-producer WorkQueue for multi-root transfers#3648
Merged
Conversation
Design note for #1382. Surveys the current SPMC contract on the bounded delta WorkQueue, evaluates three multi-producer designs, and recommends a Clone-based fan-in API (with_producers(n)) that surfaces the producer-count contract as a Vec of N senders. Covers ordering via per-producer sequence ranges, backpressure, drain_parallel interaction, and migration for multi-root transfers, --files-from + walker concurrency, and future async producers. Wire-compat impact: zero (channels are internal coordination only).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Design note for #1382. Surveys the current SPMC contract on the bounded delta WorkQueue, evaluates three multi-producer designs, and recommends a Clone-based fan-in API (with_producers(n)) that surfaces the producer-count contract as a Vec of N senders. Covers ordering via per-producer sequence ranges, backpressure, drain_parallel interaction, and migration for multi-root transfers, --files-from + walker concurrency, and future async producers. Wire-compat impact: zero (channels are internal coordination only).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Design note for #1382 covering a multi-producer extension to the bounded
delta
WorkQueueso multi-root transfers (oc-rsync foo/ bar/ baz/ dst/)and parallel directory enumeration (#1573) can fan in to one shared queue.
Key sections
crates/engine/src/local_copy/executor/sources/orchestration.rs:79and the SPMC contract at
crates/engine/src/concurrent_delta/work_queue/bounded.rs:11-21.evaluated against today's crossbeam-backed channel.
with_producers(n)returning aVec<WorkQueueSender>that surfaces the producer-count contract in the type system.
fallback already validated by the existing test
multi_producer_requires_atomic_sequence_coordination.drain_parallelinteraction (auto-close on last senderdrop), migration plan for multi-root,
--files-from, and future asyncproducers, plus risks (deadlock, sequence collisions, fairness,
adaptive policy).
Wire-compat invariants
Zero impact.
WorkQueueis internal engine coordination only; noprotocol bytes change. The wire-protocol receive path keeps its
single-producer contract documented in
crates/engine/src/concurrent_delta/multi_producer_audit.rs:8-19.Test plan
git diff origin/master..HEADconfirms onlydocs/design/multi-producer-workqueue.mdis added.