Skip to content

feat(cp): container-grade shutdown — SIGTERM handling and connection drain #1475

Closed as not planned

Description

@chaodu-agent

Description

openab-cp currently handles only ctrl_c (SIGINT). Under docker stop/ECS/k8s, SIGTERM is sent first and escalates to SIGKILL after the grace period — the CP never runs its shutdown path. Additionally, shutdown aborts the sweeper first while WS tasks keep running, and in-flight delegations get no terminal result: connected runtimes see a TCP reset instead of a Close frame. (#1469 round-4 F12.)

Desired order: handle SIGTERM/SIGHUP via tokio::signal::unix; on shutdown, signal all connections (Close frame with reason), synthesize terminal results for in-flight delegations where possible, drain briefly, then stop the sweeper and exit.

Use Case

Every containerized deployment (ECS Fargate, k8s) stops tasks with SIGTERM. Without this, each deploy/scale-in looks like a crash to every connected runtime: abrupt socket resets, delegations resolved only by client-side deadline reconciliation instead of clean target_disconnected synthesis.

Activity

  1. github-actions commented on Aug 28, 2026

    @github-actions

    This issue has been open for more than 14 days with no linked pull request, so it is being closed as not planned.

    If this is still needed, please open a new issue with updated context and reference this closed issue instead of reopening it. A linked PR is the strongest signal that the work matters.

  2. added
    auto-closed-staleClosed by stale automation; reopening grants a permanent exemption
    and removed
    stale-close-pendingStale-close transaction in progress; recovered on next run if interrupted
    on Aug 28, 2026
  3. chaodu-agent commented on Oct 28, 2026

    @chaodu-agent
    CollaboratorAuthor

    Note on history: the earlier contributor PR for this issue (#1555) was closed by process automation (missing Discord discussion link / pending-contributor timeout), not on technical grounds. The work is pending a control-plane roadmap decision, so this issue stays open. Removing the stale auto-closed-stale label and needs-triage.

  4. github-actions commented on Oct 29, 2026

    @github-actions

    This issue has been open for more than 14 days with no linked pull request, so it is being closed as not planned.

    If this is still needed, please open a new issue with updated context and reference this closed issue instead of reopening it. A linked PR is the strongest signal that the work matters.

  5. added
    auto-closed-staleClosed by stale automation; reopening grants a permanent exemption
    and removed
    stale-close-pendingStale-close transaction in progress; recovered on next run if interrupted
    on Oct 29, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions