Skip to content

The per-unit AbortSignal is unreachable from Temporal activities and AMQP handlers #23

Description

@btravers

From the 2026-08-13 repo audit.

RunUnit's work callback receives the kernel's per-unit AbortSignal — it fires at the drain deadline so in-flight work can stop cleanly. start-http forwards it into the handler as a parameter (packages/start-http/src/http-runtime.ts:96-97). Both middleware-based runtimes drop it:

  • packages/start-temporal/src/activity-units.ts:64(ctx) => next({ context: { ctx } })
  • packages/start-amqp/src/message-units.ts:57 — same shape

So a Temporal activity and an AMQP handler have no access to the signal, and a drain deadline the work cannot observe defeats the point of handing one out. No stated reason in either package.

Acceptance

  • The per-unit AbortSignal reaches the activity/handler context in both packages (e.g. alongside ctx in the middleware context), or a written reason why the transport's own cancellation story makes it redundant (Temporal heartbeat/cancellation may be that reason — if so, say it where the middleware lives).
  • The examples show the signal being honoured in at least one non-HTTP runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions