Skip to content

M3: Bound process termination in stop_task and shutdown #76

Backlog

Description

@h45sh

Context

Executor.stop_task (src/ether/core/executor.py:196-206) calls process.terminate() and then await process.wait() with no timeout. A child that ignores SIGTERM (or is stopped in T) makes stop_task / shutdown wait forever.

ExecutionSession.kill_job (src/ether/core/session.py:1083-1099) awaits runner.stop(...) before cancelling the task, so an ether kill / MCP abort_action against such a process hangs too. The streaming path already uses terminate → wait_for(..., 1-2s) → kill (run_tool); the stop path does not.

Acceptance criteria

  • Terminate → bounded wait → kill → bounded wait; never block indefinitely.
  • Make shutdown() bounded and idempotent across all tracked tasks.
  • Clean _active_processes on every path, including the kill fallback.
  • Test with a child that traps SIGTERM; stop_task returns within the bound and the exit code is recorded.

Out of scope

PTY-specific termination (tracked separately).

Related to #47

Activity

  1. added this to the M3 Signal milestone on Nov 30, 2026
  2. added
    type:bug
    area:telemetry
    priority:P1
    on Nov 30, 2026
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

    area:telemetrypriority:P1type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions