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

doc: add notes that timer jobs should be side-effect-free #682

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented Jan 17, 2025

... other than submitting the self-call, of course

@ggreif ggreif requested a review from a team as a code owner January 17, 2025 14:59
@ggreif ggreif requested review from crusso and rvanasa January 17, 2025 17:22
@ggreif ggreif self-assigned this Jan 17, 2025
mergify bot pushed a commit to dfinity/motoko that referenced this pull request Jan 17, 2025
This fixes a disappearing timer situation described by Timo in https://dfinity.slack.com/archives/CPL67E7MX/p1736347600078339.

It turns out that under high message load the `async` timer servicing routine cannot be run. The fix is simple, check if the self-call succeeded (causes a `throw` already), and if not, set a very near global timer to retry ASAP (in the top-level `catch`).

TODO:
- [x] `catch` send errors for user workers (and mitigate) — see #4852
- [ ] document that the user thunk may be called more than once, and thus should have no side effects other than submitting the self-call — see dfinity/motoko-base#682
@ggreif ggreif enabled auto-merge (squash) January 17, 2025 22:49
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