-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CHASM: bug fix: handle empty run ID in PollComponent #8862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dandavison
merged 9 commits into
standalone-activity
from
saa-poll-activity-execution-bug-fix
Dec 18, 2025
Merged
CHASM: bug fix: handle empty run ID in PollComponent #8862
dandavison
merged 9 commits into
standalone-activity
from
saa-poll-activity-execution-bug-fix
Dec 18, 2025
Conversation
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
dandavison
commented
Dec 18, 2025
| return ref, nil | ||
| ref, err = checkPredicateOrSubscribe() | ||
| if err != nil || ref != nil { | ||
| return ref, err |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just some minor code cleanup, irrelevant to the PR.
fretz12
approved these changes
Dec 18, 2025
This reverts commit b7d31a31c39fcb28d641fa970e0246525a7d3638.
This reverts commit 078bbcb550a779563baf1d0109a888c3d59e738f.
9f6a22b to
a8952b1
Compare
awln-temporal
approved these changes
Dec 18, 2025
024499c to
9cfa128
Compare
dandavison
added a commit
that referenced
this pull request
Dec 19, 2025
## What changed? In `chasm.PollComponent`, if the passed component ref has empty run ID, resolve this to the current run ID. ## Why? The previous code state was broken: it was possible to submit `PollActivityExecution` with no run ID, which led to `Subscribe(key)` being called where key lacked a run ID. But the notifications were being sent to a different key (one with the run ID) which led to the long-poll never receiving any notification and hence always timing out. Existing chasm APIs `ReadComponent` and `UpdateComponent` both accept empty run ID and silently resolve it to current using `getExecutionLease`. It was a bug that `PollComponent` resolved to current using `getExecutionLease`, but then subscribed to notifications using a key that did not contain the resolved run ID. At the external API level, in several of our non-CHASM user-facing gRPC APIs, empty run ID means "use latest at the time the request is processed" (e.g. `GetWorkflowExecutionHistory`). And we want these semantics for CHASM APIs such as `PollActivityExecution`. This change gives those semantics. ## How did you test it? - [x] built - [x] added new unit test(s) - [x] added new functional test(s)
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 changed?
In
chasm.PollComponent, if the passed component ref has empty run ID, resolve this to the current run ID.Why?
The previous code state was broken: it was possible to submit
PollActivityExecutionwith no run ID, which led toSubscribe(key)being called where key lacked a run ID. But the notifications were being sent to a different key (one with the run ID) which led to the long-poll never receiving any notification and hence always timing out.Existing chasm APIs
ReadComponentandUpdateComponentboth accept empty run ID and silently resolve it to current usinggetExecutionLease. It was a bug thatPollComponentresolved to current usinggetExecutionLease, but then subscribed to notifications using a key that did not contain the resolved run ID.At the external API level, in several of our non-CHASM user-facing gRPC APIs, empty run ID means "use latest at the time the request is processed" (e.g.
GetWorkflowExecutionHistory). And we want these semantics for CHASM APIs such asPollActivityExecution. This change gives those semantics.How did you test it?
Note
PollComponent now subscribes using the resolved execution key (including RunID) to avoid missed notifications; adds unit/functional tests including PollActivityExecution with empty RunID.
PollComponent: subscribe via notifier using resolved workflow key fromexecutionLease.GetContext().GetWorkflowKey()(NamespaceID,BusinessID,RunID) instead ofrequestRef.ExecutionKey.service/history/chasm_engine_test.go:PollComponentwith empty vs non-emptyRunID; resolves emptyRunIDviaGetCurrentExecutionand verifies notifications use resolvedExecutionKey.RunID.tests/standalone_activity_test.go:TestPollActivityExecution_EmptyRunIDto verify emptyRunIdresolves to current and returns expected outcome.Written by Cursor Bugbot for commit 9cfa128. This will update automatically on new commits. Configure here.