fix: ignore: parallel walker occasionally hangs if visitor panics (#3009)#3328
Open
krapcys1-maker wants to merge 2 commits intoBurntSushi:masterfrom
Open
fix: ignore: parallel walker occasionally hangs if visitor panics (#3009)#3328krapcys1-maker wants to merge 2 commits intoBurntSushi:masterfrom
krapcys1-maker wants to merge 2 commits intoBurntSushi:masterfrom
Conversation
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.
Fixes #3009
Summary
Fixes a nondeterministic hang in
ignoreparallel walk when visitor code panics.Problem
WalkParallel::visit()/WalkParallel::run()could hang after a panic in visitor logic. The panic did not always terminate worker progression cleanly, leaving threads stuck in work retrieval loops.Reproduction
From
crates/ignore, run parallel tests repeatedly (as described in #3009) until a panic path is hit; on affected code this can hang.What changed
crates/ignore/src/walk.rsWorker::run, wraprun_one(work)withstd::panic::catch_unwind.quit_now()beforeresume_unwind(payload)so all workers observe quit state and stop.Why this works
The change preserves panic propagation while ensuring global worker shutdown is signaled on panic, preventing the hang/livelock behavior.
Validation
cargo check --workspacecargo test -p ignore --lib -- --nocaptureScope
Single-file, targeted fix in
ignoreworker loop.