Repository navigation
prove: gated #1052 race cases fail without the early-message buffer - #1078
Draft
chappie-daemon wants to merge 9 commits into
Draft
chappie-daemon wants to merge 9 commits into
chappie-daemon wants to merge 9 commits into
Conversation
The cases all send at the open tick, but beforeEach stubs the admission check to resolve immediately, so the adapter installs its normal listener before any frame can arrive and the buffering path is never exercised. holdAdmission() leaves the check pending until the frames are in the server's queue, then admits; every case now goes through the replay path. Shape 1 also asserted only that each socket saw some REQ. It now requires exactly one frame per socket, the full command shape, and the multiset of subscription ids received to equal the ids sent.
Issue #1052 asks for the reply a client is entitled to, not survival. The adapter spec stops at frame delivery, so it cannot see a dropped REQ or a subscription left live by a racing CLOSE. These six features drive a real app over a real socket and assert EOSE, OK and NOTICE: - 10 sockets subscribing at the open tick, 20 rounds, exactly one EOSE each - two REQs in one turn answered in order - REQ and CLOSE in one turn: no event on the closed id, live subscription still receives, socket still answers - EVENT at the open tick: OK with ok=true - fragmented and binary frames honoured, next command still answered - invalid JSON refused with a NOTICE, socket usable afterwards
onClientMessage does not make a later message wait for an earlier one, and each subscribe handler sends EOSE when its own query finishes, so two replies can arrive in either order. Both must arrive; their order is not the relay's to promise. after-frames stays last in the framing case because it is sent only after the other two have answered.
Without a delay the admission check answers before a frame written at the handshake can reach the server, so the cases passed even with the early-message buffer removed — the race they name never happened. Admission is a Redis round trip in production; hold it for 50 ms for these scenarios only, which is what the #1045 unit case does with its own unresolved promise.
A fixed 50 ms window races CI load: the check can answer before a frame reaches the server, and the case then passes against an adapter that drops it. Admission now waits on an explicit gate per scenario, released only once the frames written at the handshake have been flushed.
🦋 Changeset detectedLatest commit: 281bd6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
Collaborator
Coverage Report for CI Build 42427749577Coverage decreased (-2.4%) to 75.221%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions331 previously-covered lines in 38 files lost coverage.
Coverage Stats💛 - Coveralls |
The gate alone proves admission cannot answer early; it says nothing about whether the frames have reached the server by the time it does. Wait for them after the flush, then release, so a client writing at the handshake is always inside the admission window.
This branch has not been 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.
Temporary. Reverts the #1045 buffering under the gated socket-race features. Closed and deleted once CI reports.