Skip to content

Reset scheduler state after batch errors#17

Merged
jkelaty-rbx merged 5 commits into
Roblox:mainfrom
Nendalla:fix/scheduler
Apr 20, 2026
Merged

Reset scheduler state after batch errors#17
jkelaty-rbx merged 5 commits into
Roblox:mainfrom
Nendalla:fix/scheduler

Conversation

@Nendalla

Copy link
Copy Markdown
Contributor

Fixes signals-scheduler so failed batch or scheduled work no longer leaves the scheduler stuck in a continuing state with stale queued continuations. The scheduler now clears pending continuations and restores its state before rethrowing the original error

I've also added test coverage for errors thrown by both batched work and scheduled work

@Nendalla Nendalla requested a review from a team as a code owner April 10, 2026 21:54
@jkelaty-rbx

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! The scheduler is definitely in need of improved error handling so this is definitely a welcome change.

Also, since this is our first public contribution, we're still ironing out the documentation/workflows that allow us to ingest new changes internally. This PR made me realize we had a gap in our contributing guide for flagging changes, which I have addressed in a recent commit: #19 the tldr; is basically that logic changes should be put behind a feature flag, which should be centralized in this package: https://github.com/Roblox/signals/blob/main/modules/signals-flags/src/init.lua you can basically just pattern match from the existing flag, and/or read over the full instructions here: https://github.com/Roblox/signals?tab=contributing-ov-file#code-guidelines

Comment thread modules/signals-scheduler/src/SignalsScheduler.lua Outdated

@jkelaty-rbx jkelaty-rbx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple more thoughts on the implementation but otherwise this looks good

Comment thread modules/signals-scheduler/src/SignalsScheduler.lua Outdated
Comment thread modules/signals-scheduler/src/SignalsScheduler.lua Outdated
Co-authored-by: jkelaty-rbx <78873527+jkelaty-rbx@users.noreply.github.com>

@jkelaty-rbx jkelaty-rbx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! I need to get one more reviewer from Roblox to approve this before it can be merged, which I will do early next week (hopefully Monday!)

@jkelaty-rbx jkelaty-rbx merged commit 11cc18a into Roblox:main Apr 20, 2026
1 check passed
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.

4 participants