repro: a panicked scan worker leaves the scanner busy forever - #2720
Draft
dorianvp wants to merge 1 commit into
Draft
repro: a panicked scan worker leaves the scanner busy forever#2720dorianvp wants to merge 1 commit into
dorianvp wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Claim
A panic inside
scan(..)leaves aScanWorkerbusy forever, so the scanner ticks without progress and without an error.pepper-sync/src/scan/task.rs:660-690:ScanWorker::runspawns a tokio task and stores theJoinHandleinself.handle, but nothing ever polls it.is_scanningis storedfalseonly at the end of the loop body, afterscan(..)returns.pepper-sync/src/scan/task.rs:585:Loader::check_errorshows the pattern that is missing for workers.pepper-sync/src/scan/task.rs:169:Scanner::idle_workeronly returns workers withis_scanning == false.pepper-sync/src/scan/task.rs:252:ScannerState::Shutdownonly drains idle workers.pepper-sync/src/scan.rs:142-154:scanpanics on.expect("compacts blocks should not be empty")and onpanic!("compact blocks do not match scan range!"), which are reachable from server data.What the test does
scan::task::tests::panicked_scan_worker_is_reported_or_idlebuilds aScanWorkerwithMainNetworkparams, empty ufvks, and an unbounded results channel, callsrun(1024), and sends aScanTaskfor range10..20with no compact blocks. After 500 ms it asserts the invariant that a panicked worker is either reported (anErron the results channel) or marked idle.Observed output on current
devThe worker task is finished (
handle.is_finished() == true), theJoinErroris never observed,is_scanningstaystrue, and nothing is sent on the results channel.Notes
This PR is a reproduction only and does not contain a fix. The sync-bench A/B rule was not run because the commit adds a test only.
🤖 Generated with Claude Code