mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-10-25 00:09:53 +00:00
* fix(node-repl): let the kernel exit promptly on shutdown The kernel reads its input pipe through a file stream, and a pending read on that pipe keeps process.exit() from completing until the pipe reaches EOF. Since the manager began waiting 2.5 s for a graceful exit before signalling, every reset and disposal cost about 3 seconds and ended in SIGTERM, which also slowed the node-repl suite from ~35 s to ~3.8 min in CI. End the pipe right after the shutdown frame so the kernel can exit as soon as its cleanup finishes. * fix(node-repl): stop session processes when the kernel exits on its own Ending the kernel's input pipe lets it exit within milliseconds, so the group signals that used to reach processes the session started without detaching were no longer sent: they kept running after reset, disposal and a cancellation timeout. When the kernel exits on its own, signal its process group the way the signalled shutdown did: SIGTERM, then SIGKILL if anything is still in the group after 500 ms. The group keeps its ID while any member lives, and a kernel that was already gone before termination began is left alone. Tests start a child from session code that holds a socket to the test, so its exit is seen even when nothing reaps it, and cover reset, disposal, a timed-out cancellation barrier and a child that ignores SIGTERM. The idle-kernel test now checks that no signal reaches a running kernel rather than that no signal is sent at all. * fix(node-repl): stop leftover session processes after a SIGTERM exit too The process group stop ran only when the kernel exited within the first grace period. A kernel whose own cleanup outlasts it (a slow Computer Use disposal, say) exits during the SIGTERM wait instead, so neither the group stop nor the SIGKILL ran, and a session process that ignores SIGTERM kept running. Before the pipe was closed that kernel could not finish exiting, so the old path always reached SIGKILL. Run the group stop whenever the kernel exits before the hard stop. A test blocks Computer Use disposal past the grace period and checks that a SIGTERM-ignoring child is still stopped. * test(node-repl): pin the SIGTERM step of the leftover-process sweep The slow-cleanup case was named for a kernel that exits on SIGTERM, but the kernel ignores SIGTERM once shutdown has started; it exits when the fixture's cleanup ends. Rename it and assert the group got SIGTERM while the kernel was still running, so a kernel that exits in the first wait no longer passes for this path. Add a case whose session process handles SIGTERM by writing a marker and exiting, so replacing the SIGTERM-then-SIGKILL sweep with a bare SIGKILL fails a test. |
||
|---|---|---|
| .. | ||
| desktop-relay | ||
| fixtures/napi | ||
| runtime | ||
| cell-bindings.ts | ||
| cell-transform.test.ts | ||
| cell-transform.ts | ||
| debug-log.test.ts | ||
| debug-log.ts | ||
| index.ts | ||
| kernel-manager.test.ts | ||
| kernel-manager.ts | ||
| mcp-server.test.ts | ||
| mcp-server.ts | ||
| node-repl.lines.test.ts | ||
| node-repl.napi.test.ts | ||
| node-repl.reload.test.ts | ||
| node-repl.scale.test.ts | ||
| node-repl.semantics.test.ts | ||
| output-adapter.test.ts | ||
| output-adapter.ts | ||
| protocol.test.ts | ||
| protocol.ts | ||
| security-policy.test.ts | ||
| security-policy.ts | ||
| tokenizer.test.ts | ||
| tokenizer.ts | ||
| win-path.test.ts | ||
| win-path.ts | ||