cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.21k stars 301 forks source link

🐛 Bug Report — Runtime APIs - Durable Objects with SQLite storage - calling deleteAll() in alarm handler causes internal error #2993

Open lucidplot opened 1 day ago

lucidplot commented 1 day ago

I think I've found a bug in the SQLite storage backend for Durable Objects. When I call deleteAll() from an alarm handler, it causes an internal error. Which means the alarm handler fails and keeps getting retried.

However, if I do await this.ctx.storage.deleteAlarm(); before calling deleteAll(), it works fine.

(I'm using this as a workaround with no problem. But it seems like a bug.)

Use case: I want to use alarms to delete all data, for eg a verify link that auto-expires.

FWIW this problem didn't seem to happen when I was using the KV storage backend.

joshthoward commented 1 day ago

@lucidplot we've confirmed this and are working on a fix. Thank you for reporting this issue!