docs(audits): Arc<Mutex<Vec>> contention under parallel stat static analysis (#1192)#3727
Merged
Merged
Conversation
…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>.
e77252d to
7c860fe
Compare
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>.
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
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).map_blocking(crates/transfer/src/parallel_io.rs:107-125) delegates to rayon'sinto_par_iter().map().collect(). The three remaining production sites are SSH stderr drain (aux_channel.rs:99,148) anddrain_parallelshards (drain.rs:63-64); only the latter is on a rayon hot path and is sharded already.Mutex<Vec>.Test plan
rg "Arc<Mutex<Vec"workspace search.