Repository navigation
Conversation
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: 5b1d79b716
ℹ️ 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".
| failure.value = Failure(endpoint, error) | ||
| break | ||
| } | ||
| if (connected == null) delay(250) |
There was a problem hiding this comment.
Propagate discovery failure during admission retries
When a worker has already consumed an endpoint and connect keeps returning null because admission remains exhausted, this retry loop never receives from endpoints again. If the endpoint channel then closes exceptionally—or was already closed exceptionally after that endpoint—the failure is never observed, output never closes with its cause, and a session waiting for connections can hang indefinitely despite the documented fatal-stream behavior. The retry path needs to monitor and propagate an upstream failure while preserving retries for temporary admission pressure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3cf0840. Admission retries now inspect a drained endpoint stream after the bounded retry delay and propagate its exceptional close; normal closure still permits the consumed endpoint to connect. The new regression times out before the fix and passes after it. Existing normal-close retry and queued-connection failure tests also pass. The combined child stack passed 515 JVM and 494 executed iOS tests with zero failures; final annotation-only correction was compiled on both targets.
|
Superseded by #236 (V2 scheduling and download execution) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
V2 sessions can now start before peers are connected and consume negotiated arrivals while processing peer traffic and storage completions. Selection rotates between those event sources, waits for pool capacity, validates each arrival's full torrent identity, and handles a finished connection stream without polling.
The new dialer bounds concurrent handshakes and queued results. Admission pressure retries the same endpoint after a bounded delay; ordinary failures and peer timeouts are recorded without stopping later attempts. Session cancellation joins workers and closes queued or blocked-send connection handles. Endpoint-stream failures follow already queued results.
Stacked on #208; part of #162. Endpoint authorization, deduplication and retry policy, tracker/DHT production, and public engine registration remain upstream integration work.
Validation at
5b1d79b716a919168a25b475fa06e0b2ff885925: 506 JVM and 485 executed iOS simulator tests, zero failures/errors/skips; both pinned v1 conformance scenarios and native dependency guard passed. Tests cover worker bounds, admission retry timing, timeout isolation, undelivered ownership, discovery-stream failure, and actual pure-v2/hybrid TCP downloads arriving into empty sessions, including rejection of a connection for another torrent.