Upgrade apalis to v1.0.0-rc and move the job store to its own SQLite database #177
Labels
No labels
kind
bug
kind
enhancement
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/vernier#177
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
Vernier's background jobs run on apalis 0.7.4, which pins sqlx 0.8 while the rest of the app is on sqlx 0.9. That forces two sqlx majors to compile into one binary and two pools onto one SQLite file, with a documented workaround threading the queue library's re-exported sqlx through the infra crate. Upstream has meanwhile moved on: 0.7 is the end of the old line, active development happens on the 1.0 release candidates, and the SQLite backend now lives in its own crate on sqlx 0.9. The app is not yet deployed, so there is a one-time window to take the breaking upgrade — and restructure where jobs are stored — with no data migration and no rollout risk.
Solution
Upgrade to apalis 1.0.0-rc.9 with the apalis-sqlite backend (1.0.0-rc.8) and retire the dual-sqlx workaround. Move the job store onto its own SQLite database file, created automatically beside the app database. Port behavior identically — same six queues, same terminal-vs-retryable semantics, same retry budgets and backoff, same worker set, same Reconciler guarantees — while explicitly defending against the RC's sharp edges: the database-side attempt cap that silently shrinks retry budgets, and the abort-detection mechanics that only recognize the queue library's own abort error as the outermost boxed type.
User Stories
Implementation Decisions
apalis-sqldependency forapalis-sqlite; pinapalisandapalis-sqlitewith exact (=) version requirements at 1.0.0-rc.9 and 1.0.0-rc.8 respectively. Default feature sets suffice on both. Renovate will propose RC bumps as ordinary dependency PRs, each taken deliberately since every RC so far has carried breaking changes.webmention-send,webmention-verify,email-confirmation,passkey-recovery,passkey-recovery-initiate,media-optimize— replacing the type-name-derived namespaces, so module paths stop being load-bearing serialization. Each queue's poll strategy backs off from 100ms to a 2-second cap (the library default decays to 60 seconds, which would stall the first job after an idle stretch). The orphaned-job re-enqueue interval stays at the library's 5-minute default.Testing Decisions
A good test here observes external behavior through an existing seam — a port trait, a constructor's observable effects, or the full application harness — and never asserts on the queue library's internals beyond what the seam exposes. Four existing seams cover the whole change; no new seams are introduced:
Deliberately untested: the composition root (monitor restart policy, shutdown timeout, worker registration), matching the status quo.
Out of Scope
Further Notes