Repository navigation
test(ffi): order pending connect cancellation in place - #6034
Conversation
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
|
Checkpoint: The controlled helper diagnostic proved completion before cancel is permitted. It does not reproduce the historical 2/960 failure: the original and ordered fixtures each passed 128/128 bounded repetitions on an unsaturated host. The quest remains open for the unknown historical error/root cause and loaded-host acceptance. Standard scoped checks passed, including 232 FFI and 102 Python tests. All 32 explicit native interop cells, five preflights, denial/FETCH/tails/drop lanes passed. Browser interop is blocked by Chromium1248 missing libglib-2.0.so.0; Swift was unavailable. All owned check/interop commands ended, exact harness children were reaped, and the port lease was released. Keep draft under the user's no-merge hold. (written by GPT-6.1-Sol) |
The old fixture reproduced under load (7 of 3840, all Ok(session)): the dial establishes without the server accepting, so a spawned connect can finish before cancel. The in-place poll is deterministic, so the quest is done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
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: cbd821be59
ℹ️ 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".
A real server lets the handshake finish without accepting, so a dial preempted between spawning and its first established() check could resolve on the first poll. A bound socket that never answers keeps the connect pending until cancel, with no handshake to race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
client_cancel_aborts_a_pending_connectflakes under load withassertion failed: matches!(connect_err, Err(MoqError::Cancelled)).Root cause, reproduced: the dial can establish a session even though the server never calls
accept(). The old fixture spawnedconnect, polled it once, then waited for the FFI runtime to catch up before callingcancel(). Under load the spawned task was repolled during that wait and returnedOk(session)before the cancel landed. With the old fixture plus a diagnostic print, 7 of 3840 runs (48 concurrent, host load around 50) failed, every one withconnect returned Ok("session").Approach
Dial a bound UDP socket that never answers (WebSocket fallback disabled) instead of a real server, so no handshake can finish before
cancel(). Poll the foreign connect in place, assert the first poll isPending, cancel synchronously, then resume it.Task::runchecks the cancel flag first (biased select) on its next poll, soCancelledwins by construction. Both assertions print what the connect actually returned.A real server is not enough even when polled in place: the dial is spawned on the multithreaded FFI runtime, so a test thread preempted before its first
established()check could see a finished handshake (Codex finding, fixed).The quest is complete and deleted: the race is confirmed, the test no longer depends on it, and a cancel losing to a connect that already completed is correct production behavior, not a bug.
Impact
Validation
Ok("session")).just checkandquest checkpassed.libglib-2.0.so.0; Swift was unavailable.Decisions
No maintainer decision was given; the recommended option was picked.
cancel()legitimately returns its session.cancel()revoke an already-returned session. Rejected: changes semantics with no behavioral benefit.Follow-ups
None required. The other
spawn_parkedcallers park calls that cannot complete before their trigger (a held lock, or a read with nothing to read), so none showed this gap.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code