Skip to content

Make invoke timeouts terminate process trees #2

Description

@oritwoen

What happened?

Harness.invoke() and listModels() document timeoutMs as killing the harness after the deadline, but the shared runner sends one SIGTERM to the direct child and waits indefinitely for close. A child that ignores the signal keeps the promise pending. If the child exits but has spawned descendants, those descendants remain alive.

This means the timeout is neither bounded nor recursive.

How to reproduce

Using a custom harness backed by node:

  1. Run process.on("SIGTERM", () => {}); setTimeout(() => process.exit(0), 500) with timeoutMs: 30. invoke() returned after 531 ms.
  2. Run a child that spawns a 60 second grandchild, then waits. invoke() returned with timedOut: true, but the grandchild was still alive and needed an explicit SIGKILL.

Anything else?

Terminate the owned process tree, allow a documented grace period after SIGTERM, then escalate to a hard kill. Add regression tests for ignored termination signals and surviving descendants on each supported platform.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions