Repository navigation
fix(cli): report a signal-killed indexer and exit like a shell - #3279
Open
johnhldiver-beep wants to merge 1 commit into
Open
johnhldiver-beep wants to merge 1 commit into
johnhldiver-beep wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Closes #3277
Problem
When the indexer that the CLI relaunches with the WASM runtime flags is killed
by a signal — most often an out-of-memory kill —
codegraph initandcodegraph indexexit 1 and print nothing.relaunchWithWasmRuntimeFlagsIfNeededdropped
result.signal, so a killed indexer looked like an ordinary failure,and the exit code didn't say a signal was involved.
Fix
In
src/extraction/wasm-runtime-flags.ts, when the relaunched child was killedby a signal, name it on stderr:
and exit with 128 + the signal number (137 for SIGKILL), as a shell would, so
scripts and CI can tell a kill from a failure.
Verified (disk/log-verified)
child exited 1 with no stderr (
cg3277-test1.log).wasm-runtime-flags.test.tspasses 13/13 — SIGTERM →exit 143 with
killed by SIGTERM, SIGKILL → exit 137 withkilled by SIGKILL (out of memory?)(cg3277-test2.log).npm testsuite: 10523 passed / 2 failed, both known pre-existing(untracked TypeScript: a call to a global like
parseIntornew Response()links a project export of that name the file doesn't import #3238 handover test +ui-server-apibusiest symbol, fanIn 33)(
cg3277-full.log).npm run buildexits 0 (cg3277-build2.log).result.signal.The upgrade
spawnSynchelpers (defaultRun/defaultCapture,remove-binary.ts) return numeric codes rather than decidingprocess.exit,and are a different concern, so they were left out of this one-concern diff.