Files
scheduler/.pql/changelog/tickets/2026-10.sql
T

23 lines
7.1 KiB
SQL

INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06GN6K3C1NQ7WDPM3YXD6BSTZM', 'bug', NULL, 'Long jobs stall the minute loop for their whole duration', '`process_minute` waits for every task in its batch to finish (`src/tasks/executor.py:388-389`), and the minute job runs with APScheduler `max_instances: 1` (`src/main.py:77-81`). So a long task blocks every later minute for its whole duration: the 03:05 UTC config backup (~17 minutes) skips about seventeen ticks each night — the log carries "maximum number of running instances" warnings, 16 of them in the 24 hours to 2026-10-19.
Every-minute jobs slip by that much. The workspace''s new reminder dispatch (workspace T-177) is built to catch up, so this degrades it rather than breaks it — but reminders due in that window arrive late.
Fix: run long tasks fire-and-forget (or as their own APScheduler jobs) so the minute loop only dispatches and returns.
Done when: a task that runs 20 minutes produces no skipped-instance warnings, and an every-minute task keeps firing alongside it.', 'backlog', 'medium', NULL, NULL, NULL, '2026-10-19 08:34:39.757', '2026-10-19 08:34:39.757', NULL, '4d2303e4c2a4c412b15024d0f34d4796', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at >= tickets.updated_at;
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06GN6K3CM8S6RJDH27S0W8G3WW', 'task', NULL, 'POST /tasks docs show the wrong executor name and config keys', 'Three places describe the API wrongly, found while planning the workspace''s Office (workspace T-163):
- The `POST /tasks` docstring (`src/main.py:207-270`) and `TASK_REGISTRATION.md` show `"executor": "rest_api"`, `${VAR}` inside `headers`, and a `body` key. The code requires `rest_api_executor`, substitutes `${VAR}` only in `url`, `payload` and `auth` (`src/executors/rest_api_executor.py:99-107`, `_substitute_env_vars` :203-218), and reads `payload`. Anyone copying the example gets a job that sends the literal string `${VAR}`.
- `CLAUDE.md` cites the executor loader at `executor.py:202`; it is now :279.
- `CLAUDE.md` says an unauthenticated call gets a "200-shape" reply; it is a 401 (`main.py:120-131`, confirmed live).
Done when: the docstring and `TASK_REGISTRATION.md` show a working example taken from a real job, and the two `CLAUDE.md` statements match the code.', 'backlog', 'low', NULL, NULL, NULL, '2026-10-19 08:34:39.906', '2026-10-19 08:34:39.906', NULL, 'f2ae9e8f61920cfef5f3662694236132', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at >= tickets.updated_at;
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06GN6KV0MHDTH18NEK0AYQ9514', 'task', NULL, 'pg_dump executor: back up every postgres-shared database, with a proven restore', 'A `pg_dump_executor` that backs up every database on postgres-shared, daily, with one restore proven — the workspace''s databases have no consistent backup today (the nightly config backup tars the live data directory). Driven by workspace T-175; the design is workspace D-68 (`cladmin/governance/decisions/office.md`).
Shape: modelled on `src/executors/portainer_backup_executor.py`; dumps server-side with `docker exec postgres-shared pg_dump -Fc` per database plus `pg_dumpall --globals-only` (the image''s own client is 17.10, the server 16.15); output `/mnt/media/backups/postgres`, 14 days; registered as a daily 01:30 UTC job.', 'backlog', 'high', NULL, NULL, NULL, '2026-10-19 08:37:53.444', '2026-10-19 08:37:53.444', NULL, 'a7fd33e8ccf7734935d6593e818a2f2b', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at >= tickets.updated_at;
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06GN6KV0MHDTH18NEK0AYQ9514', 'task', NULL, 'pg_dump executor: back up every postgres-shared database, with a proven restore', 'A `pg_dump_executor` that backs up every database on postgres-shared, daily, with one restore proven — the workspace''s databases have no consistent backup today (the nightly config backup tars the live data directory). Driven by workspace T-175; the design is workspace D-68 (`cladmin/governance/decisions/office.md`).
Shape: modelled on `src/executors/portainer_backup_executor.py`; dumps server-side with `docker exec postgres-shared pg_dump -Fc` per database plus `pg_dumpall --globals-only` (the image''s own client is 17.10, the server 16.15); output `/mnt/media/backups/postgres`, 14 days; registered as a daily 01:30 UTC job.
**Code done 2026-10-19** in `a14f134` (round scheduler-T-7-001): `src/executors/pg_dump_executor.py` + 32 tests; `make test` 196 passed, 19 deselected (183 → 215 collected); mutation-checked (0600, empty TOC). Verified live read-only: a PG16 custom archive of `test_scheduler` lists 19 TOC entries through the image''s 17.10 `pg_restore`. Not yet released, mounted, registered or restore-proven — that is the deployment milestone (workspace T-175).', 'backlog', 'high', NULL, NULL, NULL, '2026-10-19 08:37:53.444', '2026-10-19 08:57:29.313', NULL, '317f4ab02ee8e077989c1452c39b91f1', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at >= tickets.updated_at;