v0.7.0
v0.7.0: the lookup API, exclusion as an admission rule, and Invocation.Failure
Three contract changes and one new example, all shaped by what the engine, handler authors, and the flyd pilot need; dashboard-style listing APIs are gone.
-
Run lookup (#57, #58). A bound pipeline has three read methods:
Schedule,GetRun(id), andGetActiveRun(resource).Engine.GetRun(id)finds a run across pipelines for callers holding only a RunID, withStatusnaming the pipeline for the typed upgrade.GetActiveRunis one indexed store read. The listing methods (ListActiveRuns,GetRuns, and their engine-level counterparts) are removed. -
Exclusion groups are an admission rule (#59). A run's slot is always
(PipelineID, ResourceID); the store never persists a group. Membership is resolved from the bound definitions atEngine.Startand checked atScheduleagainst every member's slot in one transaction. Adding, removing, or renaming a group converges by itself: in-flight runs finish, new admissions follow the current definitions from the firstSchedule. This fixes a drift where a renamed group could admit two runs of one pipeline on one resource. -
Recovery walks the slot index (#60).
ListNonterminalin the bbolt driver costs the runs in flight rather than the retained history. -
Unwind handlers read the failure from the invocation (#61). The
durable.Failureparameter is gone;Invocation.Failure() *Failureis non-nil exactly inPhaseUnwind, so middleware sees it too. Typed invocations gainFailure()andLogger()(#62). -
examples/snapshots(#62) is a pipeline assembled entirely from the generatedhttp.HandlerFunc-style adapters: closures over a dependency struct, no handler types.
Breaking changes and migration
-
Unwind handlers: delete the third parameter and read
inv.Failure()where it was used.// before func (h *reserve) Unwind(ctx context.Context, inv pb.ReserveInvocation, f durable.Failure) error // after func (h *reserve) Unwind(ctx context.Context, inv pb.ReserveInvocation) error { root := inv.Failure().Root // never nil during unwind
pipelinedef.Step.UnwindFuncand the generatedXxxFuncs.UnwindFuncchange the same way.durabletest.InvocationConfiggains aFailurefield. -
Bound pipelines:
Run(id)isGetRun(id),ActiveRun(resource)isGetActiveRun(resource);Active(),Runs(resource), and the engine-level listings are removed. Keep a RunID and poll it withEngine.GetRun. -
Store SPI (
store/driver):CreateRun(ctx, rec, excluding []PipelineID)takes the exclusion set;GetActiveRunID(ctx, pipeline, resource)is new;RunRecord.Groupis gone. Third-party drivers must check every excluded pipeline's slot atomically with their own. -
bbolt databases: proto field 4 of the run meta (
slot_group) is reserved and ignored; a v0.6.0 database opens unchanged. A run created under a persisted group keeps running and is admitted against by the new rule.
contrib/durableotel v0.7.0 is released in lockstep.
Modules
github.com/dangra/durable@v0.7.0github.com/dangra/durable/contrib/durableotel@v0.7.0
What's Changed
- Bound pipeline lookups: GetRun, GetActiveRun, ListActiveRuns, GetRuns by @dangra in #57
- Drop the listing APIs; GetActiveRun becomes one indexed read by @dangra in #58
- Exclusion groups are an admission rule, never a persisted slot by @dangra in #59
- bbolt: ListNonterminal walks the slot index by @dangra in #60
- Unwind handlers read the failure through Invocation.Failure by @dangra in #61
- examples/snapshots: a pipeline assembled from handler func adapters by @dangra in #62
- Release v0.7.0 by @dangra in #63
Full Changelog: v0.6.0...v0.7.0