Repository navigation
fix(cluster): do not store a reply for a request deleteProcessed removed - #10985
Merged
tim-smart merged 4 commits intoNov 27, 2026
Merged
Conversation
saveReply updated the request row and inserted the reply without checking the request still existed. A reply saved after deleteProcessed removed its request was stored with nothing referencing it, and retention never deleted it. saveReply now locks the request first, like acknowledgements and interrupts already do, and stores nothing when it is gone. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 9d4184d The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 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.
|
Merge the late reply case into the existing test for late acknowledgements and interrupts, and check stored replies through repliesForUnfiltered.
This branch is waiting to be deployed
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.
saveReplyupdated the request row and inserted the reply without checking that the request still existed. A reply saved afterdeleteProcessedremoved its request (for example, one that waited behind the delete) was stored with nothing referencing it, so retention never deleted it.Fix
saveReplynow locks the request row withlockRequestfirst, assaveEnvelopealready does forAckChunkandInterrupt, and stores nothing when the row is gone. This keepsdeleteProcessed's request-first lock order.Test
The existing late-write test, now
does not store late envelopes or replies for a request deleteProcessed removed, also saves a late chunk and exit reply and assertsrepliesForUnfilteredreturns none. It runs on pg, mysql, mssql and sqlite and fails on each without the fix.The mssql test
rejects duplicate exit replies when another table has the same index namenow saves its request first, so it still checks the unique exit index.Checked locally:
pnpm check,oxlint,dprint, andSqlMessageStorage.integration.test.ts(121 passed).pnpm test-clusterhas 8Entity.test.ts/Locks.test.tsfailures that also occur without this change.Closes EFF-4558