New ask Hacker News story: Durable Object alarm loop: $34k in 8 days, zero users, no platform warning
Durable Object alarm loop: $34k in 8 days, zero users, no platform warning 9 by thewillmoss | 0 comments on Hacker News. Sharing this as a warning to anyone using Cloudflare Durable Objects with alarms. Root cause: My DO agent's onStart() handler called this.ctx.storage.setAlarm() on every wake-up without checking whether an alarm was already scheduled. Combined with 60+ preview Worker deployments each creating independent DO instances, this created a runaway self-health-check loop. Timeline: - April 3: loop began (zero DO usage before this date) - April 4-5: peaked at ~930 billion row reads/day - April 11: found it, fixed it - April 15: $34,895 invoice due with no billing response yet The fix: // Before (dangerous) async onStart() { await this.ctx.storage.setAlarm(Date.now() + 60_000) } // After (safe) async onStart() { const existing = await this.ctx.storage.getAlarm() if (!existing) { await this.ctx.storage.setAlarm(Date.now() + 60_000) } } Other things worth doing: - Strip D...