fix: propagate signal exit code from the npm bin wrapper#101
Open
Volkov Daniil (codeGaus) wants to merge 1 commit into
Open
fix: propagate signal exit code from the npm bin wrapper#101Volkov Daniil (codeGaus) wants to merge 1 commit into
Volkov Daniil (codeGaus) wants to merge 1 commit into
Conversation
When the real binary is killed by a signal, spawnSync sets result.status to null and result.signal to the signal name, and the wrapper exited 0 — reporting success for a killed process. Exit with the conventional 128 + signal number (falling back to 1) so callers and CI see the failure.
|
Volkov Daniil (@codeGaus) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
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.
What does this PR do?
backend/cli/bin/openscience(the npm launcher) ran the platform binary viaspawnSync. When that binary is killed by a signal,result.statusisnullandresult.signalholds the signal name — but the wrapper didtypeof result.status === "number" ? result.status : 0, so it exited 0 and reported success for a killed process (e.g. an OOM kill or Ctrl-C). This exits with the conventional128 + signal number(falling back to1), so shells, callers and CI observe the failure.How did you verify your code works?
node --checkon the wrapper passes. The change follows the standard shell convention (128 + signum) usingos.constants.signals, which is alreadyrequired in the file. The launcher is a plain executable script with no existing unit coverage (its behavior is process-level), so no unit test was added.Checklist
bun run typecheck— n/a (plain JS launcher, not part of the TS build)bun test— n/a (no coverage for the launcher; signal handling is process-level)node --checkpasses