Conversation
…tration TestRedis_StreamXReadBlockChecksWrongTypeAtDeadline blocked for 2s and waited up to 2s for the stream waiter to register before overwriting the key. The wrong-type check runs when the block deadline fires, so a SET that lands after it gets the ordinary block-timeout nil instead -- which the test reports as "redis: nil" does not contain "WRONGTYPE" On a loaded machine the registration wait can consume the whole window before the SET is sent. Reproduced exactly by delaying the SET past the deadline. The block window is now 6s and the registration wait 1s, so the two no longer share a budget: a slow registration fails as "the waiter never appeared", with its own message, rather than surfacing later as a confusing nil read. The registration timeout is a parameter now, since any caller whose assertion depends on acting before the reader's deadline has to bound it well under that deadline. Claude-Session: https://claude.ai/code/session_013rNHooj7NF3giihWVba8QE
|
Warning Review limit reachedNext included review available in 53 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1e10274af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // machine could consume the whole window before the SET was sent. | ||
| const ( | ||
| blockWindow = 6 * time.Second | ||
| waiterRegistering = time.Second |
There was a problem hiding this comment.
Allow more time for waiter registration
When a loaded runner needs more than one second to perform the XREAD's initial work and register the otherwise healthy waiter, this newly shortened timeout fails the test before the widened six-second block window can provide any benefit. The original helper allowed two seconds, and the reported flake demonstrates that this setup can be delayed substantially; keep at least that tolerance (while still remaining safely below blockWindow) so the timing fix does not replace the confusing nil failure with a more frequent registration-timeout flake.
Useful? React with 👍 / 👎.
|
CI の gRPC はサーバ側が既に終了させたストリームへの #1252 で 4 箇所すべてを修正しました。マージ後に main を取り込めばこの CI は緑になるはずです。 |
TestRedis_StreamXReadBlockChecksWrongTypeAtDeadlineis timing-dependent and took downtest (ubuntu-latest)on #1222, which touches onlyinternal/snapshotoffload.Mechanism
The test blocked for 2 s and waited up to 2 s for the stream waiter to register before overwriting the key:
The wrong-type check runs when the block deadline fires, so a
SETthat lands after it gets the ordinary block-timeout nil instead:Registration and the remaining block window drew on the same 2 s, so a loaded machine could consume the whole window before the
SETwas sent.Reproduced, not guessed
Delaying the
SETpast the deadline produces the identical failure:Fix
Block window 6 s, registration wait 1 s — the two no longer share a budget. The registration timeout becomes a parameter, because any caller whose assertion depends on acting before the reader's deadline has to bound it well under that deadline, and it now carries its own failure message, so a slow registration fails as "the waiter never appeared" rather than surfacing later as a confusing nil read.
Risk
None to production: test-only, no production file touched. The test's subject — that the wrong-type check happens at the deadline — is unchanged; only the margin around it is.
Test evidence
go test ./adapter/ -run TestRedis_StreamXReadBlockChecksWrongTypeAtDeadline -count=5— okSET(the condition that broke it): passes at the new 6 s window, and fails with the original 2 s window — so the widened window is what does the work, not the injected delay.golangci-lint --config=.golangci.yaml run ./adapter/...— 0 issuesSelf-review
t.Parallel(), so the cost to the suite is minimal.Fourth timing-dependent test flake in this batch (#1236 carries three others). All four share a shape: an assertion pinning one of several equally-correct outcomes, or a budget shared between setup and the thing being measured.
@codex review
@claude review
https://claude.ai/code/session_013rNHooj7NF3giihWVba8QE