Skip to content

Fix duplicate activity cancellation commands - #1814

Open
tconley1428 wants to merge 1 commit into
mainfrom
fix/activity-cancel-idempotency
Open

Fix duplicate activity cancellation commands#1814
tconley1428 wants to merge 1 commit into
mainfrom
fix/activity-cancel-idempotency

Conversation

@tconley1428

Copy link
Copy Markdown
Contributor

Fixes #1813.

When workflow cancellation and an explicit activity-handle cancellation reach the same activity task, emit one cancellation command per activity sequence. Command allocation now occurs in cancellation callbacks, allowing the activity path to suppress duplicates without producing an empty command.

Adds a regression test that queues the signal and workflow cancellation while the workflow worker is offline, verifies they are delivered in one activation, and asserts the workflow completes without failed workflow tasks.

Validation:

  • poe test -s tests/worker/test_workflow.py::test_workflow_cancel_activity_while_workflow_cancelled
  • poe lint

@tconley1428
tconley1428 requested a review from a team as a code owner September 3, 2026 17:57
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.

Activity cancellation is not idempotent: cancelling an activity while the workflow itself is being cancelled fails the workflow task with TMPRL1100

2 participants