Repository navigation
💥 Schedule async markers like regular threads - #3110
Merged
Quinn-With-Two-Ns merged 5 commits intoOct 3, 2026
Merged
Conversation
Contributor
Author
|
related: #2981 |
maciejdudko
requested changes
Oct 2, 2026
maciejdudko
left a comment
Contributor
There was a problem hiding this comment.
Awesome! The code looks good, just needs rebasing. LGTM!
Quinn-With-Two-Ns
force-pushed
the
schedule-async-marker
branch
from
October 2, 2026 15:53
02aabf5 to
a1749f3
Compare
maciejdudko
approved these changes
Oct 2, 2026
Quinn-With-Two-Ns
force-pushed
the
schedule-async-marker
branch
from
October 2, 2026 22:06
ec8c05e to
3caba2c
Compare
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
Added
SCHEDULE_ASYNC_STUB_OPERATIONS, which queues detected Async stub calls in command order without allocating a workflow thread. The flag remains disabled by default. Previously async stub were executed inline.Why?
Changing an Async call between a stub method reference and a lambda can change command order and break replay. The flag provides a way to preserve that order for histories that record it.
In practice this meant that changing workflow code from this:
to this
was not deterministic. After this change and the flag is enabled it would be a deterministic change.
Checklist
Closes
How was this tested:
Note
Medium Risk
Touches core Async/replay command ordering in AsyncInternal; mitigated by default-off flag and replay tests, but enabling it changes scheduling semantics for new runs.
Overview
Introduces versioned
SCHEDULE_ASYNC_STUB_OPERATIONSSDK flag (off by default) so that when it is recorded in workflow history,Async.function/Async.procedureon Temporal stubs are dispatched through a workflow thread like generic lambdas, instead of running stub logic inline on the caller thread.AsyncInternal.executenow checks the flag before branching: legacy behavior keeps immediateinvokeTemporalStub; with the flag, stub work iscompleteFrom(invokeTemporalStub(...))insideWorkflowThread.newThread, aligning command order between equivalent forms such asactivities::firstand() -> activities.first()and letting outbound interceptors observe/block around scheduling. Unflagged histories still replay with the old inline-stub path.CHANGELOG notes the behavior; tests add replay fixtures (method reference ↔ lambda, unflagged), blocking-interceptor and cancellation cases (activities and child workflows).
Reviewed by Cursor Bugbot for commit 3caba2c. Bugbot is set up for automated code reviews on this repo. Configure here.