Repository navigation
fix(engine): stop parse workers on failure and interrupt - #428
Draft
vibgrate-team wants to merge 1 commit into
Draft
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
A crashed parse worker made pool shutdown throw an uncaught stack, and a parent that exited without kill left child workers reparented. Stop workers on failure, SIGINT, SIGTERM, and normal exit, and report a one-line remedy. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.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.
Summary
vg buildandvg scanparse through a worker pool. Two shutdown gaps left that pool unsafe on a bad run:destroy()throw an uncaughtTypeError: emitter.removeListener is not a function, so the process dumped a stack instead of a usable error.process.exitwithout killing its workers could leave those workers reparented (they show up as straynodeprocesses running tinypool's process entry).The pool now cancels and destroys workers when parsing finishes, when parsing fails, and on SIGINT/SIGTERM. If
destroy()does not finish, workers are killed. Expected failures print one line — what failed, and whether to re-run with--jobs 1,--exclude, orVG_WORKER_HEAP_MB— andvg buildsurfaces that as a normalerror:line. A scan that cannot build the map records the same line and continues. Parse order is still sorted by path, so graph output is unchanged.Related issues
Closes #301
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
worker_threads.child_processis covered by the same kill path so a worker that is an OS process cannot outlive the command. The regression harness (test/fixtures/parse-pool-harness.ts) starts a failing and an interrupted pool and asserts the process list is clear afterwards.--import,--require, or--inspect, so a loader or debugger port is not a second long-lived Node process. Heap flags such as--max-old-space-sizeare still passed through.pnpm lintstill reports the same five pre-existing unused-variable warnings; this change adds none.