Skip to content

Proactively cancel activities on workflow termination and timeout#10047

Draft
rkannan82 wants to merge 3 commits intomainfrom
kannan/cancel-activity-on-terminate
Draft

Proactively cancel activities on workflow termination and timeout#10047
rkannan82 wants to merge 3 commits intomainfrom
kannan/cancel-activity-on-terminate

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Apr 24, 2026

What

When a workflow is terminated or times out, dispatch cancel commands to workers for in-flight activities that registered a control queue. Extends the mechanism from #9233 to cover forceful workflow close scenarios (including reset, which terminates the old run).

Guarded by EnableCancelActivityWorkerCommand. Disabled.

Why

Previously, workers only discovered workflow termination/timeout passively via heartbeat (NOT_FOUND) or when completing the activity. If heartbeat isn't enabled, activities run to completion uselessly.

How did you test it?

  • Unit tests covering filtering logic (control queue, started clock, feature flag) and multi-queue batching.
  • E2E tests for terminate and reset: verify cancel command arrives on control queue with matching task token.

🤖 Generated with Claude Code

rkannan82 and others added 3 commits April 23, 2026 22:27
When a workflow is terminated or times out, dispatch cancel commands to workers
for in-flight activities that registered a control queue. Previously workers
only discovered this passively via heartbeat or NOT_FOUND on completion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dc tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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