Skip to content

[Scheduler] Fix the race between SchedulerCallbacksTask and InvokerProcessBufferTask that lead to dropped actions#10195

Open
lina-temporal wants to merge 1 commit intomainfrom
sched-migrate-callback-race
Open

[Scheduler] Fix the race between SchedulerCallbacksTask and InvokerProcessBufferTask that lead to dropped actions#10195
lina-temporal wants to merge 1 commit intomainfrom
sched-migrate-callback-race

Conversation

@lina-temporal
Copy link
Copy Markdown
Contributor

What changed?

  • SchedulerCallbacksTask must now complete for migrated schedules before GeneratorTask/InvokerProcessBufferTask are fired.

Why?

  • If InvokerProcessBufferTask runs before CallbacksTask, it may operate on stale RunningStarts. Worse, InvokerProcessBufferTask will always win that race as it is an immediate pure task (runs with end of TX) vs a side effect task (async).
    • V1 scheduler migration is triggered before a V1 workflow refreshes its own running state, so it is prudent for V2 to do the refresh up-front after migration.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

  • If CallbacksTask is stuck, no other tasks will fire for migrated workflows. Seems no worse a fate than dropping actions on the floor.

…ocessBufferTask that lead to dropped actions
@lina-temporal lina-temporal requested a review from chaptersix May 7, 2026 21:42
@lina-temporal lina-temporal requested review from a team as code owners May 7, 2026 21:42
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.

1 participant