Gate interrupt e2e's run-signal assertion under alwaysReplay - #774
Open
nstandif wants to merge 1 commit into
Open
Gate interrupt e2e's run-signal assertion under alwaysReplay#774nstandif wants to merge 1 commit into
nstandif wants to merge 1 commit into
Conversation
Under alwaysReplay, delivering a sibling fiber's already-ready durable completion requires the attempt to suspend, but the SDK won't suspend while a run() is still pending — and that run() can only stop being pending via interrupt() (gated behind that same suspend) or its own fallback. Closed loop: the run signal never has a chance to observe the abort in that mode, only its own fallback ever fires. The journaled interrupt-delivery path (the actual SDK contract under test) is unaffected and asserted unconditionally in both modes. Also clean up waitForAbort's abort listener and fallback timer so the promise settles exactly once, instead of leaving both live after resolution.
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.
Fixes #773.
Under alwaysReplay, delivering a sibling fiber's already-ready durable completion requires the attempt to suspend, but the SDK won't suspend while a run() is still pending — and that run() can only stop being pending via interrupt() (gated behind that same suspend) or its own fallback. Closed loop: the run signal never gets a chance to observe the abort in that mode, only its own fallback ever fires, regardless of the fallback's duration (measured at 0/200/5000/20000ms — same outcome, different speed).
The journaled interrupt-delivery path (
this.wakethrowing into the fiber, the actual SDK contract this test verifies) is unaffected —resultpasses 100% reliably in every mode and every variant tested. Only the auxiliary, non-journaledobs.workerside-channel is unobservable under alwaysReplay by construction.Changes
packages/libs/restate-sdk-gen/e2e/interrupt.e2e.test.tsexpect(obs.worker).toBe("aborted")to!alwaysReplay; keep theresultassertion unconditional in both modes.waitForAbort's abort listener and fallback timer so the promise settles exactly once instead of leaving both live after resolution — this masked the real issue before: a stale listener firing after the promise had already resolved via timeout was overwritingobs.workerback to"aborted".Testing
Verified against current
main(3/3 green) and against #771'snode_endpoint.tsfix cherry-picked on top (3/3 green), so this doesn't depend on merge order between the two PRs.