Skip to content

Conversation

@yuandrew
Copy link
Contributor

@yuandrew yuandrew commented Dec 10, 2025

What was changed

Fixed a scenario where selectors without default branch was having shared data c.recValue overwritten. Also re-enables the SDK flag SDKFlagBlockedSelectorSignalReceive

Why?

Fix bug

Checklist

  1. Closes Lost messages from workflow.NewChannel(ctx) #2066 and Signal sent to Selector can be lost if Default path blocks  #1624

  2. How was this tested:
    Added new test


Note

Fixes selector receive logic to avoid losing channel items with multiple workers and changes UNBLOCK_SIGNAL_SELECTOR default handling; adds a targeted test.

  • Workflow runtime:
    • Selector receive handling updated in internal/internal_workflow.go to only pre-store c.recValue when a default branch exists; otherwise defer storage in readyBranch to avoid races when multiple selectors block on the same channel. Uses SDKFlagBlockedSelectorSignalReceive gating.
  • Flags:
    • Change unblockSelectorSignal default to os.Getenv("UNBLOCK_SIGNAL_SELECTOR") != "false" in internal/internal_flags.go (enabled unless explicitly set to "false").
  • Tests:
    • Add TestChannelWorkerPattern in internal/internal_workflow_testsuite_test.go validating no values are lost with two workers consuming the same channel.

Written by Cursor Bugbot for commit 128d3ff. This will update automatically on new commits. Configure here.

@yuandrew yuandrew requested a review from a team as a code owner December 10, 2025 18:01
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.

Lost messages from workflow.NewChannel(ctx)

1 participant