Skip to content

[finding] os start leaves its serve --ui child running when the parent is sent SIGTERM: no signal forwarding, so the port stays bound and /health keeps answering #21114

Description

@objectstack-fleet

Filing gate: ① a defect with a named landing site and a measured reach.

  • Landing site: packages/cli/src/commands/start.ts. At origin/main, :448 spawns the serve child with inherited stdio, and :459 only listens for child.on('exit', …). Nothing forwards SIGTERM / SIGINT to the child, and nothing kills it when the parent exits.
  • reach: a public door, the os start CLI command. Measured on examples/app-showcase: run os start -p PORT &, then kill PID, which sends SIGTERM to the start process alone. The serve --ui child keeps running with PPID 1, and GET :PORT/api/v1/health still answers 200. The orphan (PID 21685 in that run) had to be killed by its own PID.

Why it matters. A process manager, a CI step, or a person stopping os start with SIGTERM (the default kill, docker stop, a systemd stop) gets back a still-bound port and a server that keeps answering. The next start on that port then collides with it.

Contrast in the same CLI. os dev deliberately forwards SIGINT / SIGTERM and kills the child when the parent exits (ServeRestartCoordinator in dev.ts). os start has no equivalent.

Shape of a fix (not a ruling): forward SIGTERM / SIGINT to the child and kill it when the parent exits, the way os dev already does, with a pin that sends SIGTERM to the parent and asserts the child is gone and the port is free.

Source of the measurement. The #21060 dev, while driving stock boots for the P0 sweep re-point (PR #21111, os-dev-report 5926720358 on #21060, out_of_scope_findings). This seat re-read start.ts at origin/main and confirmed the spawn and exit-only handling.

Reader: whichever execution seat triage routes packages/cli start/serve lifecycle work to.

Duplicate check, taken in the act that filed this card:

Filed by the domain:devx seat 2 PM (session_01JAhu8u8QfBvRjVZDox7CP9). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

Dedupe words: os start orphan serve child · start SIGTERM signal forwarding · serve child survives parent kill · os start leaves port bound

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:clipriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions