Repository navigation
fix(cloudflare): wake-ups from alarm callbacks run on time - #2916
Merged
Merged
Conversation
… run on time Closes #2915
Contributor
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:2916:dac138d@alchemy.run (17)pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:2916:dac138dTransitive Dependencies (9)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:2916:dac138dpnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:2916:dac138dPublished |
…ecovery after failed runs
- background drains run apart from the callback invocation that started them, so their wake-ups aren't rejected once it ends - projection and outbox backstops report progress
…upts sleeps and retries uncaptured defects
…ine ignores repeated signals and interrupts runs on their way to a wait
…resumes runs suspended on failure and fails fast on raceAll
…ns waits an activity reaches outside its step, keeps Activity.retry attempts
…ionEngine gives in-step waits the engine
…rted platform limits
sam-goodwin
added a commit
that referenced
this pull request
Nov 2, 2026
Port #2916 (alarm-callback progress, workflow progress cursor) into the shared alchemy/Workers runtime.
This was referenced Nov 7, 2026
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.
Wake-ups scheduled from inside a Durable Object alarm callback inherited that callback's retry backoff, with nothing failing. Workflow sleeps and Domain projection batches came in late, and each hop's delay doubled.
Bugs fixed
15 bugs, each pinned by a test that fails on main (except #2, found in review), plus two platform limits that used to hang and now fail fast. The conformance suite found 12 of the 15.
DurableObjectEngineDurableObjectEnginewaitUntilinside a callback lost its wake-up; batches waited for the backstop (35s, not 5s)NativeEngineNativeEngineNativeEngineNativeEngineresumedid nothingDurableFunctionEngineDurableFunctionEngineDurableFunctionEngineDurableFunctionEngineActivity.retrysaw attempt 1 on every retryDurableFunctionEngineDurableFunctionEngineresumedid nothingActivity.raceAllhung forever onNativeEngineandDurableFunctionEngine. Neither platform can read a step's result before running it, so a race can't replay its winner there. Both now die at once with a message that points to the Durable Object engine.DurableObjectEngineThe engine keeps a journal cursor and passes it as the callback
progress. The cursor update commits in the same transaction as the journal write and the wake-up:A deferred completed a second time reports no progress and leaves a pending wake-up alone, so the limit on self-rearms without progress (#1908) still holds.
One conformance suite for every engine
test/Workflows/conformance/holds the workflows, the routes, and 28 cases, drawn from Effect's own engine tests and from bugs found here. Each engine's suite deploys a fixture and calls it:It runs on the Durable Object engine (also with the EU jurisdiction) and the native engine, each locally and live, and on
Lambda.WorkflowFunction. It found #6–#15 and theraceAlllimit.Callback scheduler
A cursor from a different callback no longer hides a schedule. It used to drop it silently:
Domain
waitUntilfrom inside a callback lost its wake-up once that invocation ended. A batched projection's first input waited for the backstop, about 35s instead of the 5s batch wait. These drains now run outside the alarm pass.Closes #2915