Skip to content

fix(cloudflare): reset alarm attempts on healthy workflow wake-ups - #2802

Closed
amoscicki wants to merge 1 commit into
alchemy-run:mainfrom
amoscicki:fix/workflow-wakeup-progress
Closed

amoscicki wants to merge 1 commit into
alchemy-run:mainfrom
amoscicki:fix/workflow-wakeup-progress

Conversation

@amoscicki

Copy link
Copy Markdown

Sequential DurableClock.sleep calls on the Durable Object engine back off as if they were failing. Each clock → run hop inherits the alarm attempts of the pass that scheduled it, so the retry delay doubles per hop and at maxAttempts the execution parks for an hour (#2801).

for (let poll = 0; poll < 10; poll++) {
  // longer than the 60 s inMemoryThreshold, so every sleep goes through the alarm
  yield* DurableClock.sleep({ name: `poll-${poll}`, duration: "5 minutes" });
}
// before: every handoff adds an attempt, wake-ups come late by the growing retry delay,
// and after 4 sleeps (8 handoffs) the execution parks for an hour; now each sleep wakes when due

The clock schedule and the wake-up after a completed deferred now pass the row count of the engine's append-only journal tables as progress, which AlarmCallback already treats as progress. Start, resume and interrupt keep their unconditional wake-up, and a pass that fails before writing a journal row still spends the retry budget.

Fixes #2801

Written with AI help (Claude Opus 5.5, OpenAI Sol 6.1, OpenAI Astra 6).

@amoscicki

Copy link
Copy Markdown
Author

Fixed in #2916.

@amoscicki amoscicki closed this Nov 7, 2026
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.

DurableObjectEngine: sequential durable sleeps inherit alarm retry backoff

1 participant