Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Durable Object Alarms not triggering after a code reload #3566

Open
lambrospetrou opened this issue May 31, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@lambrospetrou
Copy link
Contributor

lambrospetrou commented May 31, 2024

Which Cloudflare product(s) does this pertain to?

Workers Runtime

What version(s) of the tool(s) are you using?

wrangler 3.57.1

What version of Node are you using?

v20.10.0

What operating system and version are you using?

Windows 10 - WSL2 - Ubuntu 22.04.3 LTS

Describe the Bug

Observed behavior

Scenario:

  • I have a simple Durable Object with an Alarm setup to trigger every 5 seconds.
  • I start wrangler dev to watch my source code files and reload the worker.

The alarm triggers as expected, but as soon as the code has changes and the worker reloads, then the alarm stops triggerring.
Even though the storage of the DO, and the alarm itself (through ctx.storage.getAlarm()), still exist just fine.

Check the logs below where they show the alarm triggering every 5-seconds, and then they stop after the reload:

triggers.cron alarm at 1717140295004 ::nextAlarmExecutionMs: 1717140300000 ::triggerDetails: {"scriptId":"s_nlP0bNFp6PK29WRwG2CDDzG","triggerId":"strig_cron_sG9btQVqCJQ1P","cronExpression":"*/5 * * * * *","targetUrl":"http://skybear.test:8080/-_-/v1/scripts.triggers.cron.Run?scriptId=s_nlP0bNFp6PK29WRwG2CDDzG&triggerId=strig_cron_sG9btQVqCJQ1P"}

triggers.cron alarm at 1717140300004 ::nextAlarmExecutionMs: 1717140305000 ::triggerDetails: {"scriptId":"s_nlP0bNFp6PK29WRwG2CDDzG","triggerId":"strig_cron_sG9btQVqCJQ1P","cronExpression":"*/5 * * * * *","targetUrl":"http://skybear.test:8080/-_-/v1/scripts.triggers.cron.Run?scriptId=s_nlP0bNFp6PK29WRwG2CDDzG&triggerId=strig_cron_sG9btQVqCJQ1P"}

triggers.cron alarm at 1717140305003 ::nextAlarmExecutionMs: 1717140310000 ::triggerDetails: {"scriptId":"s_nlP0bNFp6PK29WRwG2CDDzG","triggerId":"strig_cron_sG9btQVqCJQ1P","cronExpression":"*/5 * * * * *","targetUrl":"http://skybear.test:8080/-_-/v1/scripts.triggers.cron.Run?scriptId=s_nlP0bNFp6PK29WRwG2CDDzG&triggerId=strig_cron_sG9btQVqCJQ1P"}
⎔ Reloading local server...
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

# I KILLED THE wrangler server here after 1 minute.
⎔ Shutting down local server...

Expected behavior

I expected the alarm to continue triggering as usual since all the storage+alarm state is correct.

Steps to reproduce

I don't have a minimal reproduction at hand...need to clean up my project to get it.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@lambrospetrou lambrospetrou added the bug Something isn't working label May 31, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk May 31, 2024
@lambrospetrou
Copy link
Contributor Author

@andyjessop andyjessop moved this from Untriaged to Backlog in workers-sdk Aug 9, 2024
@penalosa
Copy link
Contributor

As it stands, this is "by-design", since workerd doesn't allow for updating workers without a full reload of the process (killing alarms). As such, I'm going to transfer this to the workerd repo.

@penalosa penalosa transferred this issue from cloudflare/workers-sdk Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants