Restore stored jobs at start, ending interrupted sends uncertain

Breaking: job status can be "uncertain", a new status value. Clients
that switch on status must handle it.

The queue loads what its store keeps before the worker, the server and
the subscriptions start. Queued deliveries wait again in submission
order, ahead of any new job, even beyond queue.size: Submit answers
queue_full until the backlog falls below it. Restored statuses answer
at once, and the sequence continues from the highest stored.

A delivery found in sending at start may have reached the printer, so
the store ends it uncertain, a new terminal state, and it is never sent
again; a person checks the paper and sends it again if it is missing.
Each one is logged once at WARN by its job's ID, printer, source and
reference. A job's status is uncertain once all its deliveries have
finished and any is, over failed over done.

With the memory store there is nothing to restore, so the daemon
behaves as before; a store on disk comes in stage 1d. Part of stage 1c
of docs/plans/job-store.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-12-01 13:45:07 -06:00
1 parent 9b25c1bfd3
commit 45b57ab196
9 files changed
+405 -21

No files matched your search

+5 -4
View File
@@ -397,11 +397,11 @@
"type": "string"
},
"error": {
"description": "error says why a failed job failed.",
"description": "error says why a failed job failed, or that an uncertain one may have printed.",
"type": "string"
},
"finished_at": {
"description": "finished_at is when the job was done or failed.",
"description": "finished_at is when the job was done or failed, or when a start found it uncertain.",
"format": "date-time",
"type": "string"
},
@@ -428,12 +428,13 @@
"type": "string"
},
"status": {
"description": "status is where the job is in its lifecycle.",
"description": "status is where the job is in its lifecycle. uncertain is a job that was being sent to the printer when the daemon stopped: it may have printed, and it is never sent again.",
"enum": [
"queued",
"printing",
"done",
"failed"
"failed",
"uncertain"
],
"type": "string"
}