Fix replay of durable calls completed in the crash window - #3749
Merged
Conversation
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.
✅ Deploy Preview for golemcloud canceled.
|
Contributor
Author
|
Note: the huge diff is due to WIT changes causing regenerated bindings |
This comment has been minimized.
This comment has been minimized.
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01e9e-994d-75dd-bf1f-83f6c9ba3a4d Co-authored-by: Amp <amp@ampcode.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes the crash-window replay divergence originally observed as the flaky Go outgoing-HTTP replay test (
go_outgoing_http_replayed_without_networkon thego-sdkbranch).Linear: GOL-443
Problem
The executor recorded a durable call's
Endentry 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:
Endkeeps recording host completion and persists the result.CompletionDelivered/CompletionDiscardedrecord 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 viasubtask.cancel/ cancellation).Endwith a marker waits for its exact marker before releasing the result to the guest; a markerlessEnd(the crash window) waits for natural replay-tail exhaustion and then becomes live-armed, so the guest re-observes the completion in live mode.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 branchmainpins), andCargo.lockis 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.go-sdkbranch; the same executor fix passed it there 40/40 across repeated runs.