Skip to content

Record cancelled workflows as Canceled in duroxide.executions#179

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-cancelled-workflows-status
Draft

Record cancelled workflows as Canceled in duroxide.executions#179
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-cancelled-workflows-status

Conversation

Copy link
Copy Markdown

Copilot AI commented May 27, 2026

Cancelled workflows could end as Failed in duroxide.executions.status, while df.status()/df.instances reported cancelled. This mismatch made cancellations indistinguishable from true failures in execution-level queries.

  • Status normalization in runtime-managed durable schema

    • Added worker-installed normalization functions/triggers to map cancellation outcomes to durable-store terminal status Canceled in duroxide.executions.
    • Added backfill normalization for pre-existing mismatched rows (Failed execution rows tied to df.instances.status = 'cancelled').
  • Race-safe cancellation convergence

    • Added normalization on both sides of the race:
      • when df.instances.status transitions to cancelled;
      • when duroxide.executions.status is inserted/updated.
    • This closes timing windows where cancellation and execution-finalization were previously recorded out of sync.
  • Worker schema versioning

    • Bumped WORKER_SCHEMA_VERSION so the worker readiness/version marker reflects installation of the new normalization behavior.
  • Targeted regression coverage

    • Extended cancellation consistency E2E coverage to assert duroxide.executions.status resolves to cancellation (canceled/cancelled) rather than Failed.
UPDATE duroxide.executions e
SET status = 'Canceled'
FROM df.instances i
WHERE i.id = e.instance_id
  AND i.status = 'cancelled'
  AND e.status = 'Failed';

Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cancelled workflows status in duroxide.executions Record cancelled workflows as Canceled in duroxide.executions May 27, 2026
Copilot AI requested a review from pinodeca May 27, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancelled workflows are recorded as Failed in duroxide.executions status

2 participants