Repository navigation
[dotnet-port-fixes] Deliver to repeated fan-out targets once - #1336
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
API consistency review
Changed Go contract
Upstream evidence reviewed
AssessmentUpstream applies an unconditional ordinal
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the runtime fan-out deduplication change.
No open issues 🎉
What changed in this PR
This PR prevents duplicate delivery to repeated fan-out targets at runtime, extending the earlier SwitchBuilder-specific fix in #706.
Changes:
- Deduplicates resolved target IDs while preserving first-occurrence order and target filtering.
- Adds a regression test for an assigner that selects the same targets repeatedly.
| File | Description |
|---|---|
workflow/internal/execution/edgerunner.go |
Deduplicates selected target IDs so each target receives the message once. |
workflow/internal/execution/edgerunner_test.go |
Adds coverage for repeated target selections from an assigner. |
Review effort: Balanced
Summary
A fan-out edge delivered a message once per entry when its
Assigner(or sink list) named the same target more than once, so a target could run twice on one message.selectedTargetIDsinworkflow/internal/execution/edgerunner.gonow drops repeated IDs, keeping the order in which each target is first named. This matches upstreamFanOutEdgeRunner, which appliesDistinct(StringComparer.Ordinal)to the resolved target IDs. #706 fixed only theSwitchBuilderper-case path; the runtime path was still unguarded.Ported .NET PRs
Breaking Changes
No. Repeated targets now run once, which is the intended contract.
Tests and Examples
I added
TestPrepareDeliveryForFanOutEdge_AssignerRepeatedTargetsDeliveredOnceinworkflow/internal/execution/edgerunner_test.go. No example changes were needed.gofmtis clean andgo test ./workflow/...passes.Notes
EdgeRunner.PrepareDeliveryForEdgeviaselectedTargetIDs.