adr: own the durable-job backend as an event-sourced apalis Backend#30
adr: own the durable-job backend as an event-sourced apalis Backend#300xgleb wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label add-to-gt-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
26ef346 to
584ed9e
Compare

Motivation
durability from the event store itself. The current implementation breaks
that coupling: it leans on apalis-sqlite and hand-writes rows into apalis's
private
Jobstable to fake atomicity.(enqueue) split against one table; an exact
=rc.8pin tracking apalis'schurning private schema; an inconsistent/contorted atomic-enqueue story; and
the empty-event-commands-silently-drop-jobs gap (HIGH on adr: jobs replace services #8/feat: replace EventSourced::Services with Jobs and wire atomic enqueue #15).
Solution
apalis_core::Backendover an event-sourced job modelowned by event-sorcery, and drop apalis-sqlite. apalis stays the execution
engine; we own storage + the job lifecycle, with job transitions as events in
the same store -- the
Lifecyclepattern one layer up.Enqueuedevent commits in the triggeringaggregate's transaction); the empty-event gap dissolves; double-claim safety
via optimistic-concurrency on the job stream; durable retry owned by the model.
ADR-0001 and reshapes the jobs stack (feat: add job module #11/feat: add buffered JobQueue and apalis enqueue #14/feat: replace EventSourced::Services with Jobs and wire atomic enqueue #15). Open question in the ADR:
rework the in-flight stack before merge vs land the backend as a follow-up.