Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
force-pushed
the
1fannnw/workflow-stream-cancellation
branch
from
September 28, 2026 20:28
1098bf5 to
b58133f
Compare
Member
|
@1fanwang From CI:
|
…ream-cancellation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Contributor
Author
@brianstrauch Done in 55d19f7. |
brianstrauch
enabled auto-merge (squash)
October 1, 2026 22:03
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
An activity whose workflow stream subscription is cancelled now raises
CancelledError instead of seeing the iterator end normally. Before this change,
such an activity could return success even though Temporal had requested its
cancellation.
The subscription rethrows direct task cancellation and cancellation wrapped by
WorkflowUpdateRPCTimeoutOrCancelledError. RPC timeouts and server-side RPC
cancellation keep their existing continue-as-new and terminal-workflow handling.
Why?
Activity code that loops over a subscription has no other way to learn that
Temporal cancelled it, so cleanup and cancellation reporting were skipped.
Checklist
Closes: no linked issue.
How was this tested:
The probe starts a local Temporal dev server, runs the regression test's
workflow and activity, waits until the heartbeating activity is polling a
workflow stream, and then cancels it. The activity catches CancelledError
directly around the subscription and returns a distinct value for each outcome.
Reproducer source: probe.py
Before, with the stream client from main:
After, with this branch:
No. The CHANGELOG entry is under Unreleased.