Skip to content

fix: Cancel runs before a work-order rerun - #6908

Open
AleksandarCole wants to merge 1 commit into
mainfrom
fix/settle-rerun-canvas-runs
Open

fix: Cancel runs before a work-order rerun#6908
AleksandarCole wants to merge 1 commit into
mainfrom
fix/settle-rerun-canvas-runs

Conversation

@AleksandarCole

Copy link
Copy Markdown
Collaborator

Summary

A replaced traversal released its parallelism slot while its canvas run stayed active. This change requests cancellation before the replacement starts.

A mounted failed-run footer also retained its earlier Stop and Close selection. This change selects Rerun this step when the footer state changes.

Follow-up to #6899.

Made with Cursor

Replacing a traversal finished its factory execution but left the linked
canvas run active. The old run could continue to use resources and cause
side effects after the replacement started. Request cancellation before
the execution releases its parallelism slot.

Also refresh the default stop action when a mounted footer changes state.
A failed run now selects its rerun action instead of retaining the prior
Stop and Close choice.

Signed-off-by: Aleksandar Mitrovic <alex@superplane.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@superplanehq-integration

Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@superplanehq-integration

Copy link
Copy Markdown

Storybook available at https://pr-6908-storybook.superplane.workers.dev

@AleksandarCole
AleksandarCole marked this pull request as draft August 26, 2026 10:51
@AleksandarCole
AleksandarCole marked this pull request as ready for review August 26, 2026 10:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a3a8be4. Configure here.

if err := run.MarkAsCancelling(tx, nil); err != nil {
return err
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rerun cancel does not drain runs

High Severity

settleOpenWorkFrom now calls MarkAsCancelling but never DrainForCancellation and does not publish the drain or run-state messages. Other cancel paths stop node executions, drop queue items, and notify workers immediately. Here the work-order slot is released and a replacement can start while the old canvas run keeps executing until the five-minute cancelling sweep, so a waiting or API-triggered rerun can still run two steps at once.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a3a8be4. Configure here.

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.

1 participant