Commit Graph
3 Commits
Author SHA1 Message Date
Eric Traut 662daabad2 Forward repeated signals through the npm wrapper (#61221)
## Why

The npm wrapper's spawn fallback stopped forwarding signals after the first one, preventing a second signal from interrupting a child's graceful shutdown.

## What changed

Remove the `child.killed` guard so the wrapper continues forwarding `SIGINT`, `SIGTERM`, and `SIGHUP` until the child exits.

## Testing

Add a regression test that forces the spawn fallback and verifies a running child receives a second `SIGTERM` and its numeric exit status is preserved.

GitOrigin-RevId: be96e784e2e4f419c43a5897d264f55fcdfd625f
2026-11-13 01:21:09 +00:00
Michael Bolin 27ace641fe Replace the npm wrapper with the native binary using execve (#57513)
## Why

Replacing the Node process lets the native binary receive signals and report its termination directly.

## What changed

- Use `process.execve` on non-Windows platforms when available, preserving CLI arguments and the prepared environment.
- Install a `SIGXFSZ` handler before replacement so the native binary gets the default signal disposition instead of inheriting Node's ignored signal.
- Retain asynchronous spawning for Windows and older Node versions.

## Testing

Extend the exit-status test to check that `execve` leaves no child process and that `SIGHUP` and `SIGXFSZ` terminate it with the original signal, while retaining coverage for the spawn fallback.

GitOrigin-RevId: 7437f15af419fce5b10c1c00425c7d38160991fc
2026-10-27 16:55:48 +00:00
Dmitriy Kovalenko 9510f36df2 Preserve child signal failures in the npm wrapper (#57352)
## Why

The npm wrapper can exit successfully after its native child is terminated by a signal if Node ignores the re-emitted signal or a forwarding handler intercepts it.

## What changed

Set a fallback exit status of `128 + signal number` and remove listeners for the terminating signal before re-emitting it, preserving signal termination where supported.

## Testing

Add a non-Windows integration test using a built Codex binary to cover numeric argument-error exits, forwarded `SIGHUP` termination, and the fallback exit status for `SIGXFSZ`, which Node ignores by default.

GitOrigin-RevId: cad18a47aa50fd78517c367f8d8aae83bbbf7843
2026-10-27 04:39:05 +00:00