Files
nickyleachandPaperclip c2c6ba269d feat(server): add opt-in run termination to the instance task drain
Add a terminateActiveTasks option to POST /api/instance/task-drain. When
set, the server schedules a stop of every active run one grace period
(PAPERCLIP_TASK_DRAIN_TERMINATION_GRACE_PERIOD_SECONDS, default 30s)
before the drain's ttlMs expires, so an operator can safely force-stop
the process after the drain ends. The option requires a positive ttlMs
and needs no new permission: the existing instance-settings authorization
floor covers it.

A private generation number on the drain state lets a scheduled
termination test, at fire time, whether the drain it was armed for is
still live — a stop or a later start makes an in-flight timer callback a
no-op. Every arm and every outcome writes a durable activity record, with
one outcome row per company (including a company with no active run).

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-16 06:36:02 +00:00
..
2026-03-12 13:09:22 -05:00