Repository navigation
Update docs to tighten up alarm loop guardrails - #34151
Open
harshil1712 wants to merge 5 commits into
Open
harshil1712 wants to merge 5 commits into
harshil1712 wants to merge 5 commits into
Conversation
harshil1712
requested review from
a team,
dalexeenko,
danlapid,
iglesiasbrandon,
irvinebroque,
joshthoward,
lambrospetrou,
rita3ko,
vy-ton and
zqamruddin
as code owners
October 9, 2026 11:54
Contributor
AI Review✅ Reviewed Commands
|
Contributor
Review coverage🟡 4 ownership areas need approval. Suggested reviewers: @dalexeenko @irvinebroque @joshthoward @vy-ton @southpolesteve
CODEOWNERS mappings for displayed areas (4)
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://harshil-do-alarm-loop-guardrails.previews.developers.cloudflare.com (commit d41cba6)This URL reflects your latest Preview deploymentPreview Deployments by commit |
apeacock1991
reviewed
Oct 9, 2026
jclee
reviewed
Oct 12, 2026
jclee
reviewed
Oct 12, 2026
jclee
reviewed
Oct 12, 2026
jclee
approved these changes
Oct 14, 2026
Contributor
Collaborator
|
/rebase |
Co-authored-by: Ashley Peacock <apeacock@cloudflare.com>
Addresses review feedback that storing an attempt counter adds a write per alarm. An in-memory counter is not a reliable substitute: objects are evicted after 70-140s idle, so with retries >= 1 minute apart it resets between attempts and the limit never trips. - Rules of Durable Objects: the good example derives both backoff and a give-up deadline from `refreshAt`, which the object already stores. Retries need no extra storage writes, and the stop condition survives eviction. The success path now advances `refreshAt` so the deadline stays meaningful. - Alarms API: update the caution and the "Catching exceptions" note to match. - Testing: replace the run-until-stop test with two focused tests (minimum delay on retry, no reschedule after the deadline). - Storage API partial: "almost immediately" -> "immediately", consistent with earlier review suggestions. - Optimize costs: "attempt limit" -> "deadline". Verified: examples and tests type-check (strict, noUnused*); good example passes; setAlarm(Date.now()) variant fails test 1; no-deadline variant fails test 2. pnpm run check and pnpm run build pass.
Use the wording suggested by the Agents team in review. The only change from the suggested text is the scheduleEvery() link anchor (#interval).
- Rules of Durable Objects: add jitter to the backoff in the good example, as suggested in review, so retries from objects that fail at the same time are spread out. - Reword "back off on failure" to "back off for retried operations" to distinguish handler-scheduled retries from exceptions escaping alarm(), which have their own built-in backoff. Applied to the Rules bullet, the Rules intro, and the Alarms caution. - Reword "runs (again) immediately" to "is (re)scheduled to run immediately", since alarms are not guaranteed to run at an exact time. Applied to the Alarms caution, the Rules intro, the setAlarm bullet, and the storage partial. Verified: example and tests type-check; good example passes; the setAlarm(Date.now()) and no-deadline variants fail the intended tests. pnpm run check and pnpm run build pass.
cloudflare-docs-bot
Bot
force-pushed
the
harshil/do-alarm-loop-guardrails
branch
from
October 19, 2026 17:46
bcd0280 to
d41cba6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add clear information on DO Alarm running into loops and how to prevent them
Documentation checklist