Skip to content

docs(audits): Arc<Mutex<Vec>> contention under parallel stat static analysis (#1192)#3727

Merged
oferchen merged 1 commit into
masterfrom
docs/arc-mutex-vec-static-1192
May 5, 2026
Merged

docs(audits): Arc<Mutex<Vec>> contention under parallel stat static analysis (#1192)#3727
oferchen merged 1 commit into
masterfrom
docs/arc-mutex-vec-static-1192

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 5, 2026

Summary

  • Static analysis of every remaining Arc<Mutex<Vec<...>>> in the workspace, focused on the parallel stat hot path used by the receiver (candidates.rs:117-132) and the sender file-list walker (walk.rs:262-267).
  • Confirms parallel stat does not allocate any shared mutex-guarded accumulator: map_blocking (crates/transfer/src/parallel_io.rs:107-125) delegates to rayon's into_par_iter().map().collect(). The three remaining production sites are SSH stderr drain (aux_channel.rs:99,148) and drain_parallel shards (drain.rs:63-64); only the latter is on a rayon hot path and is sharded already.
  • Cites the just-merged drain-side audit (PR docs(audits): static analysis of drain_parallel Mutex contention #3699), scopes Normalize burst handling for unlimited bandwidth limits #1192 to the runtime profiling needed for closure, and lists mitigations (per-thread accumulator, lock-free MPSC, DashMap, no-op) to evaluate only if profiling surfaces a residual Mutex<Vec>.

Test plan

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 5, 2026
…nalysis (#1192)

Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace,
focused on the parallel stat hot path. Confirms parallel stat does not
allocate any shared mutex-guarded accumulator: map_blocking delegates to
rayon's into_par_iter().map().collect() with per-task buffers internal
to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel
shards), only the third is on a rayon hot path and is sharded already.

Cites the just-merged drain-side audit (PR #3699) for the drain-shards
analysis, scopes #1192 to runtime profiling needed for closure, and lists
mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
@oferchen oferchen force-pushed the docs/arc-mutex-vec-static-1192 branch from e77252d to 7c860fe Compare May 5, 2026 20:19
@oferchen oferchen merged commit 4446634 into master May 5, 2026
7 checks passed
@oferchen oferchen deleted the docs/arc-mutex-vec-static-1192 branch May 6, 2026 18:57
oferchen added a commit that referenced this pull request May 18, 2026
…nalysis (#1192) (#3727)

Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace,
focused on the parallel stat hot path. Confirms parallel stat does not
allocate any shared mutex-guarded accumulator: map_blocking delegates to
rayon's into_par_iter().map().collect() with per-task buffers internal
to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel
shards), only the third is on a rayon hot path and is sharded already.

Cites the just-merged drain-side audit (PR #3699) for the drain-shards
analysis, scopes #1192 to runtime profiling needed for closure, and lists
mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant