Skip to content

queen: long waits as rows in Postgres -- queen_wait, a scheduler actor, the release job's CI wait (waits.t27) #1717

Closed

Description

@gHashTag

Part of #1712 (item 4): long waits become rows in Postgres, so they hold no process and survive deploys.

Goal

A queen_wait table, one scheduler actor per process that claims due rows with FOR UPDATE SKIP LOCKED and wakes their owner, an API to make a wait and to resolve one by key, and the release job's CI step rewired to park on a row keyed by the run id. Behind TRIOS_QUEEN_WAITS=rows, default off.

Rules

Every decision is the card specs/queen/waits.t27 (Trinity-S-AI-DNA/t27#8270 / PR #8272, follow-up t27#8280 / PR #8282), vendored byte-identical with its wasm; the TypeScript holds rows, reads GitHub and calls the card.

Acceptance

  • A wait survives a process restart (new runtime, same database).
  • A write at a stale epoch is refused and wakes nobody.
  • Two schedulers on one table never wake the same row twice.
  • Benchmark old vs new on the same scripted release job: GitHub reads and job log entries during a 90-minute CI wait, process ms, waits lost across a forced restart, ms per step. Numbers on the PR and on Queen moves to the actor model: the rule in every AGENTS.md, an MVP, a benchmark, then the swap t27#7851.
  • The api suite fails no test that actors-next does not already fail.

Activity

  1. gHashTag commented on Oct 10, 2026

    @gHashTag
    CollaboratorAuthor

    Shipped: #1722 merged into actors-next, which went into queen as 56c5df7 via #1730 (2026-10-10 13:38Z). Every new behaviour is behind a flag that is off. Closes fires only on the default branch main, so this is closed by hand. Ledger: #1729.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions