Skip to content

Fix replay of durable calls completed in the crash window - #3749

Merged
vigoo merged 13 commits into
mainfrom
vigoo/replay-crash-window-fix
Aug 21, 2026
Merged

Fix replay of durable calls completed in the crash window#3749
vigoo merged 13 commits into
mainfrom
vigoo/replay-crash-window-fix

Conversation

@vigoo

@vigoo vigoo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes the crash-window replay divergence originally observed as the flaky Go outgoing-HTTP replay test (go_outgoing_http_replayed_without_network on the go-sdk branch).

Linear: GOL-443

Problem

The executor recorded a durable call's End entry when the host completed the operation, before the guest observed the result. A crash between host completion and guest observation (e.g. an HTTP response fully received by the host but not yet polled by the guest) made replay hand the guest a completion it never saw, causing divergent replay.

Fix

The oplog now separates host completion from guest consumption:

  • End keeps recording host completion and persists the result.
  • CompletionDelivered / CompletionDiscarded record whether the guest actually consumed the completion (delivered through waitable-set wait/poll, a guest callback, or sync lowering — or consumed without observing the result via subtask.cancel / cancellation).
  • During replay, an End with a marker waits for its exact marker before releasing the result to the guest; a markerless End (the crash window) waits for natural replay-tail exhaustion and then becomes live-armed, so the guest re-observes the completion in live mode.
  • Cancelled partial results remain immediately deliverable.

The delivery point is captured with terminal observers added to the golem-wasmtime fork; the required changes are already merged into golem-wasmtime-v46.0.1-p3 (the branch main pins), and Cargo.lock is updated to that revision.

The oplog format change is not backward compatible; acceptable for the unreleased format.

Validation

  • cargo test -p golem-worker-executor --lib -- durable_host::replay_state durable_host::concurrent — 139/139 passed on this branch.
  • cargo test -p golem-worker-executor --lib -- tail_gated — 3/3 passed.
  • The original flaky Go integration test only exists on the go-sdk branch; the same executor fix passed it there 40/40 across repeated runs.

The executor recorded a durable call's End entry when the host completed
the operation, before the guest observed the result. A crash between host
completion and guest observation (e.g. an HTTP response fully received by
the host but not yet polled by the guest) made replay hand the guest a
completion it never saw, causing divergent replay. Originally observed as
the flaky Go outgoing-HTTP replay test.

The oplog now separates host completion from guest consumption:

- End keeps recording host completion and persists the result.
- CompletionDelivered / CompletionDiscarded record whether the guest
  actually consumed the completion (delivered through waitable-set
  wait/poll, a guest callback, or sync lowering - or consumed without
  observing the result via subtask.cancel / cancellation).
- During replay, an End with a marker waits for its exact marker before
  releasing the result to the guest; a markerless End (the crash window)
  waits for natural replay-tail exhaustion and then becomes live-armed,
  so the guest re-observes the completion in live mode.
- Cancelled partial results remain immediately deliverable.

The delivery point is captured with terminal observers added to the
golem-wasmtime fork (branch golem-wasmtime-v46.0.1-p3), which fire exactly
when the guest consumes a subtask's terminal event.

The oplog format change is not backward compatible; this is acceptable for
the unreleased format.
@vigoo
vigoo requested a review from a team August 20, 2026 09:28
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for golemcloud canceled.

Name Link
🔨 Latest commit 1b62b63
🔍 Latest deploy log https://app.netlify.com/projects/golemcloud/deploys/6a8802147fdcc600088c1e72

@vigoo

vigoo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Note: the huge diff is due to WIT changes causing regenerated bindings

@blacksmith-sh

This comment has been minimized.

vigoo and others added 12 commits August 20, 2026 14:58
@vigoo
vigoo merged commit 36d3dac into main Aug 21, 2026
54 checks passed
@vigoo
vigoo deleted the vigoo/replay-crash-window-fix branch August 21, 2026 08:18
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant