Skip to content

Prevent unbounded alarm scheduling promise chain in ActorSqlite.#6371

Closed
vaibhavSharma-cf wants to merge 1 commit intocloudflare:mainfrom
vaibhavSharma-cf:vaibhav/alarm-later-chain-fix
Closed

Prevent unbounded alarm scheduling promise chain in ActorSqlite.#6371
vaibhavSharma-cf wants to merge 1 commit intocloudflare:mainfrom
vaibhavSharma-cf:vaibhav/alarm-later-chain-fix

Conversation

@vaibhavSharma-cf
Copy link

When user code repeatedly moves a Durable Object alarm to a later time and scheduleRun calls to the alarm manager take longer than local SQLite commits (common in production), the alarmLaterChain promise chain grew without bound. This caused alarms to fire at times far in the past and could block SRS commits for arbitrarily long when a subsequent setAlarm moved the alarm earlier.
Replace the unbounded chain with a coalescing mechanism: at most one scheduleRun is in-flight at a time, and rapid intermediate alarm times are collapsed into a single pending value.

When user code repeatedly moves a Durable Object alarm to a later time
and scheduleRun calls to the alarm manager take longer than local SQLite
commits (common in production), the alarmLaterChain promise chain grew
without bound. This caused alarms to fire at times far in the past and
could block SRS commits for arbitrarily long when a subsequent setAlarm
moved the alarm earlier.
Replace the unbounded chain with a coalescing mechanism: at most one
scheduleRun is in-flight at a time, and rapid intermediate alarm times
are collapsed into a single pending value.
@vaibhavSharma-cf vaibhavSharma-cf requested review from a team as code owners March 20, 2026 11:41
@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@vaibhavSharma-cf
Copy link
Author

@ask-bonk

@vaibhavSharma-cf
Copy link
Author

Recreating as a branch on cloudflare/workerd (instead of fork) so reviewers can be added.

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