Skip to content

task: remove the early resolution buffer - #135

Merged
JoshVanL merged 2 commits into
dapr:mainfrom
JoshVanL:remove-early-resolution-buffer
Oct 5, 2026
Merged

JoshVanL merged 2 commits into
dapr:mainfrom
JoshVanL:remove-early-resolution-buffer

Conversation

@JoshVanL

@JoshVanL JoshVanL commented Oct 5, 2026

Copy link
Copy Markdown

A completion, failure, timer firing or child result that reached the replay before the workflow had scheduled the matching step was buffered (#125) and delivered once the step was scheduled. That made the Go SDK the only SDK that tolerated such an early resolution: Python, Java and JavaScript replay in order and ignore a resolution with no pending step, so the fix lived in one SDK while the cause, a backend that dispatches before it saves, stayed.

dapr now hands the worker such a resolution after the events that lead the workflow to schedule the step, for new events and for histories already persisted in that shape (dapr/dapr#10590). The SDK goes back to ignoring an unmatched resolution, now with a warning, like the other SDKs.

The applier change from #133 stays: a scheduling whose resolution is already in the state is recorded but not dispatched. That is what keeps the step from running twice, and the backend relies on it.

A completion, failure, timer firing or child result that reached the replay
before the workflow had scheduled the matching step was buffered (dapr#125) and
delivered once the step was scheduled. That made the Go SDK the only SDK that
tolerated such an early resolution: Python, Java and JavaScript replay in
order and ignore a resolution with no pending step, so the fix lived in one
SDK while the cause, a backend that dispatches before it saves, stayed.

dapr now hands the worker such a resolution after the events that lead the
workflow to schedule the step, for new events and for histories already
persisted in that shape (dapr/dapr#10590). The SDK goes back to ignoring an
unmatched resolution, now with a warning, like the other SDKs.

The applier change from dapr#133 stays: a scheduling whose resolution is already
in the state is recorded but not dispatched. That is what keeps the step from
running twice, and the backend relies on it.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 12:25
@JoshVanL
JoshVanL requested a review from a team as a code owner October 5, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Task-kind validation and compatibility with persisted out-of-order histories remain unresolved.

Review effort: Balanced
Findings: 2 High severity

Open (2)
What changed in this PR

Removes Go SDK early-resolution buffering, shifting event-ordering responsibility to the backend while preserving dispatch suppression.

Changes:

  • Warn and ignore resolutions without pending steps.
  • Replace buffering tests with ordering tests.
  • Update applier comments without changing behavior.
File Description
task/​task.go Removes task-kind tracking and immediate callback handling.
task/​orchestrator.go Removes resolution buffers and adds unmatched-event warnings.
task/​orchestrator_buffered_test.go Deletes buffering tests and benchmark.
task/​early_resolution_test.go Adds ignored-versus-ordered resolution tests.
backend/​runtimestate/​applier.go Updates comments; dispatch suppression remains unchanged.
backend/​runtimestate/​applier_test.go Updates test comments only.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread task/orchestrator.go
Comment thread task/orchestrator.go
Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL
JoshVanL merged commit c447d70 into dapr:main Oct 5, 2026
2 checks passed
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.

3 participants