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: fe5d73c57d
ℹ️ 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".
| view.inFlight == pipeline || view.admissionBlocked) continue | ||
| var plan = pieces.planNext(peer.blocks) { rarity.has(peer, it) } | ||
| if (plan == null) { | ||
| val index = rarity.pick(peer) { pieces.canBegin(it) } |
There was a problem hiding this comment.
Evict unavailable assemblies before enforcing the active limit
When a peer disconnects after partially filling maxActive assemblies and the remaining peers advertise only other wanted pieces, detachPeer releases the requests but leaves those assemblies counted as active. The pieces.canBegin predicate therefore rejects every piece the remaining peers can provide; because no peer is admission-blocked and no further event is required, the session can wait indefinitely instead of continuing with available pieces.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 979922d. After joined peer departure, the session removes its availability/assignments and evicts only incomplete assemblies that no remaining peer advertises and that have no live assignments. This releases active slots without dropping completed assemblies waiting for storage. The regression uses one active slot, disjoint peer availability, a partial-piece disconnect, and a later Have: it times out with eviction disabled and passes with the fix. A separate test preserves live requests and completed assemblies. JVM focused tests and iOS compilation passed; full combined JVM/iOS validation is running in the dependent TCP-test branch.
|
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) |
A v2 download can now progress automatically from peer availability to verified file storage. The new session loop consumes the shared peer event stream and commit completions, selects rare pieces, establishes interest, dispatches block plans without waiting for socket writes, and transfers complete assemblies to the storage worker.
Only verified, flushed commits publish completion. Corrupt pieces are retried; a departing peer's blocks become available after its actor joins; disk failures stop the session. The last peer may depart while a commit is pending, and the loop still waits for that result. Availability/interest counts belong to the session, so it does not read mutable peer actor state or scan the full torrent on every block response. Admission pressure uses a bounded retry timer; healthy idle peers do not poll.
Stacked on #205, including its intentional-stop review fix; part of #162. This internal full-metainfo path uses initialized matching storage and negotiated peers. Discovery, magnet resolution, complete hash serving/seeding, corrupt-peer reputation, public runtime registration, independent-client v2 interoperability and performance gates remain outstanding.
Validation at
fe5d73c57da3654ee46544abd891ffc951e2d073: 489 JVM and 468 executed iOS simulator tests, zero failures/errors/skips; both pinned v1 conformance scenarios and native dependency guard passed. New integration tests use deterministic framed peers and real file storage to cover selected output, corruption retry, peer failure/reassignment, disk failure, all peers exhausted, last-peer departure during blocked storage, and previously verified selection without peers.Review follow-up
979922d5: after joined peer departure, unavailable incomplete assemblies without live assignments are evicted so they cannot occupy every active slot. Live requests and completed assemblies retain ownership. A deterministic one-slot/disjoint-availability regression times out with eviction disabled and passes with the fix. The dependent TCP branch at50fc348c89a4b9bbaf988858bf2107754e15b2c6includes this fix and passed 494 JVM / 473 executed iOS tests, both pinned v1 conformance scenarios, and the native dependency guard.