Skip to content

Conversation

@jeffschoner
Copy link
Contributor

This fixes #267. See that issue for more details on the bug.

This change makes signals available to code running in the first workflow task by saving any signals received before the first workflow task, then calling any signal handler registered during the first workflow task with these saved values. Because this change would otherwise affect the determinism of all workflows that start workflows with a signal, it adds a new SDK flag to preserve the previous behavior for existing workflow histories.

This is achieved by registering a special signal handler that saves signals during the first workflow task. Any signal handlers registered during the first workflow task will be immediately called with any of these saved signals. After code passes the first workflow task, the handler is removed and behavior returns to normal.

@jeffschoner jeffschoner force-pushed the save-signals-for-first-task branch from 9b9af08 to d3a2869 Compare October 15, 2023 23:37
@jeffschoner jeffschoner marked this pull request as ready for review October 15, 2023 23:56
@jeffschoner jeffschoner force-pushed the save-signals-for-first-task branch from 206bd48 to dcad0f9 Compare October 16, 2023 00:37
@DeRauk DeRauk merged commit 08fe1e9 into coinbase:master Oct 20, 2023
@jeffschoner jeffschoner deleted the save-signals-for-first-task branch January 21, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Cannot handle signals on first workflow task

2 participants