Skip to content

Drain after-response tasks on SIGTERM #1575

Open

Description

@aram356

Summary

Drain after-response tasks on SIGTERM.

Part of #1558, server-side identity on every adapter. Plan ID A3, planned in wave 5 (MVP: Fastly and Axum); priority P1, size S. Design: spec; order and dependencies: plan.

Requirements

AX-1 Production serving

The service binds a configured address, exits non-zero before listening when config, secrets or a required store fails to load, and on SIGTERM stops accepting, finishes in-flight requests and after-response tasks, and exits within a configured grace shorter than the ECS stop timeout.

ID-5 After-response work

Only pull sync and guarded follow-up writes run after the response is sent: after send on Fastly, a task drained on SIGTERM on Axum, waitUntil on Cloudflare. On Spin the work runs before the response (DEC-14; DEC-16 rules out skipping it).

Current state

What the code does today, from the design's survey at the revisions it names:

Acceptance criteria

  • AX-1: An ECS-style stop during a request with a pending record write completes the request and the write, and CI runs that test
  • AX-1: Startup with a missing secret exits non-zero before the port opens
  • ID-5: On Fastly, Axum and Cloudflare a follow-up write recorded after send is in the record before the next navigation, and on Axum SIGTERM waits for it (A3). On Spin the follow-up write lands before the response

Dependencies

Blocked by:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions