Skip to content

Run torrent peer downloads through bounded actor queues - #204

Closed
linroid wants to merge 1 commit into
torrent-v2-08-request-handofffrom
torrent-v2-08-peer-actor
Closed

linroid wants to merge 1 commit into
torrent-v2-08-request-handofffrom
torrent-v2-08-peer-actor

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Peer socket writes need an independent owner so a stalled connection cannot stall session scheduling. PeerV2DownloadActor now owns the negotiated transport, block exchange, and joined inbox reader behind admitted, bounded command/event queues.

Request acknowledgements enter the event queue before responses. Commands and event backpressure respect the earliest block/hash deadline; connection failure closes only that peer's event stream. Queued and canceled-send events release their buffers, while delivered events retain consumer ownership after actor shutdown. Cleanup also handles cancellation before the child starts.

Stacked on #203; part of #162. Shared session event multiplexing, complete hash serving/seeding, and production runtime registration remain outstanding.

Validation at a19282edbe6e24ed806a2291dc1542703d661b9f: 478 JVM and 457 executed iOS simulator tests, zero failures/errors/skips. Both pinned v1 conformance scenarios and the native dependency guard passed. New tests cover immediate-response ordering, a stalled peer alongside a productive peer, bounded event backpressure, delivered/undelivered ownership, cancellation before startup, and a hash write constrained by an earlier block deadline.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T19:21:52.657979Z a19282e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  682 files  + 5    682 suites  +5   4m 1s ⏱️ -7s
2 813 tests +15  2 813 ✅ +15  0 💤 ±0  0 ❌ ±0 
3 767 runs  +25  3 767 ✅ +25  0 💤 ±0  0 ❌ ±0 

Results for commit a19282e. ± Comparison against base commit 7294976.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

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)

@linroid linroid closed this Sep 20, 2026
@linroid
linroid deleted the torrent-v2-08-peer-actor branch September 20, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant