Repository navigation
Recover local persisted replies after lost commit acknowledgements - #10205
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 4e92dc0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
This was referenced Nov 1, 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.
Summary
A persisted, non-transactional entity request could hang forever for a local caller if its reply save committed but still reported a
PersistenceError, for example when the connection drops before the COMMIT acknowledgement arrives. The local reply handler is only resumed after a save that succeeds. Retries create a new reply id each time, so on SQL every retry hitsUNIQUE (request_id, kind). The respond chain then defects without resolving the waiter.The fix applies to the non-transactional reply path in
entityManager.ts. The transactional path already recovered this way. When saving a persisted reply fails withPersistenceError, the runner checks storage for a committedWithExitreply:Runners.notifyLocalRequestalready handles that by falling back toreplyFromStorage, so the caller reads the committed reply and the request is not replayed.The transactional recovery branch now shares the same
completeFromStoragehelper.This keeps the #9336 fast path: there is no extra storage read for fresh local requests, and storage is only read after a failed save.
Tests
Sharding.test.ts. The first exit-reply save is stored and then reported as failed, and later saves for the same request fail as a unique violation. The test asserts that the caller gets the reply, the handler ran once, and only one reply was stored. It fails (hangs) without the fix.packages/effect/test/clusterandpackages/effect/test/workflow: 317 passed.tsc -b(packages/effect),oxlint, anddprint checkare clean.Closes #10202
Closes EFF-3181