Skip to content

Conversation

@jkachmar
Copy link
Contributor

description

signalWithStart fails when the first thing executed is an Activity that is scheduled, takes some amount of time to finish executing, and is awaited before the signal handler is installed.

Comment on lines 64 to 72
signalWithActivityWorkflow :: Workflow Int
signalWithActivityWorkflow = provideCallStack do
executeActivity SignalWithActivityA (defaultStartActivityOptions $ StartToClose $ seconds 2)

var <- newStateVar []
setSignalHandler signalWithArgs $ \i -> do
$(logDebug) "updating value and unblocking workflow"
readStateVar var >>= \s -> writeStateVar var (i : s)

waitCondition (not . null) <$> readStateVar var
head <$> readStateVar var
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the test will pass if the workflow is changed in either of the following ways:

  • startActivity instead of executeActivity
  • newStateVar & setSignalHandler installed before the activity is dispatched

'signalWithStart' fails when the first thing executed is an Activity
that is scheduled, takes some amount of time to finish executing, and
is awaited _before_ the signal handler is installed.
@jkachmar jkachmar force-pushed the jkachmar/repro-signalWithStart-activity-failure branch from 8df28b1 to 90f170d Compare November 19, 2025 19:31
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.

2 participants