Skip to content

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 07 Sep 15:05
7be40b4

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), and GetActiveRun(resource). Engine.GetRun(id) finds a run across pipelines for callers holding only a RunID, with Status naming the pipeline for the typed upgrade. GetActiveRun is 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 at Engine.Start and checked at Schedule against 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 first Schedule. This fixes a drift where a renamed group could admit two runs of one pipeline on one resource.

  • Recovery walks the slot index (#60). ListNonterminal in the bbolt driver costs the runs in flight rather than the retained history.

  • Unwind handlers read the failure from the invocation (#61). The durable.Failure parameter is gone; Invocation.Failure() *Failure is non-nil exactly in PhaseUnwind, so middleware sees it too. Typed invocations gain Failure() and Logger() (#62).

  • examples/snapshots (#62) is a pipeline assembled entirely from the generated http.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.UnwindFunc and the generated XxxFuncs.UnwindFunc change the same way. durabletest.InvocationConfig gains a Failure field.

  • Bound pipelines: Run(id) is GetRun(id), ActiveRun(resource) is GetActiveRun(resource); Active(), Runs(resource), and the engine-level listings are removed. Keep a RunID and poll it with Engine.GetRun.

  • Store SPI (store/driver): CreateRun(ctx, rec, excluding []PipelineID) takes the exclusion set; GetActiveRunID(ctx, pipeline, resource) is new; RunRecord.Group is 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.0
  • github.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