Skip to content

Admit and transfer negotiated v2 peer connections - #208

Closed
linroid wants to merge 1 commit into
torrent-v2-08-session-tcpfrom
torrent-v2-08-peer-connect
Closed

linroid wants to merge 1 commit into
torrent-v2-08-session-tcpfrom
torrent-v2-08-peer-connect

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Outgoing v2 peers now have an admitted setup and ownership-transfer path. The connector validates the layout's full v2 info hash, reserves packed availability before opening a socket, negotiates v2 (including hybrid upgrade), and closes unsuccessful connections. Handshakes can use an independent budget under payload saturation.

A successful pool attach transfers socket/pipeline/availability ownership. Full-pool rejection leaves the handle caller-owned and retryable; closing a transferred handle cannot close an active peer. Availability credit remains held until joined retirement or shutdown, and closed/transferred handles drop retained protocol ownership references. Existing real TCP session tests now use this path.

Stacked on #207; part of #162. Metadata/layout admission, global network policy/socket limits, discovery, and public engine/session registration remain outstanding caller integration work.

Validation at cd6bbafa4d12dc4518e8252a8aac99c8490f5261: 500 JVM and 479 executed iOS simulator tests, zero failures/errors/skips; both pinned v1 conformance scenarios and native dependency guard passed. Tests cover no-socket admission/layout rejection, connect and handshake failures, cancellation at connect return, independent handshake credit, joined ownership retirement, rejected-handle cleanup, and pure-v2/hybrid TCP downloads on both platforms.

@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-12T20:12:42.334425Z cd6bbaf 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

  702 files  + 5    702 suites  +5   4m 17s ⏱️ -4s
2 879 tests +18  2 879 ✅ +18  0 💤 ±0  0 ❌ ±0 
3 877 runs  +30  3 877 ✅ +30  0 💤 ±0  0 ❌ ±0 

Results for commit cd6bbaf. ± Comparison against base commit 50fc348.

@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-connect 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