Skip to content

refactor(runtime-host): fence peer connection attempts - #4403

Merged
M4n5ter merged 2 commits into
mainfrom
refactor/runtime-host-peer-attempt-lifecycle
Sep 1, 2026
Merged

refactor(runtime-host): fence peer connection attempts#4403
M4n5ter merged 2 commits into
mainfrom
refactor/runtime-host-peer-attempt-lifecycle

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 31, 2026

Copy link
Copy Markdown
Member
English

Outcome

Give every outbound peer connection attempt one closed lifecycle before adding another direct transport. The attempt owns one immutable target PeerId, deadline, cancellation token, and winner commit; late or losing completions are discarded without disturbing the existing connection.

Scope

  • Fence native dial work by a generation-scoped attempt authority.
  • Commit at most one authenticated winner.
  • Reclaim child tasks on cancellation, timeout, or replacement.
  • Preserve current QUIC/DCUtR and approved member-transit behavior.
  • Add focused cancellation/winner coverage only.

This is stack 1/4 for #4382 and intentionally has no WebRTC behavior or UI.

Verification

  • cargo fmt --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked
中文

结果

在加入第二种直连 transport 前,先让每次 outbound peer connection attempt 只有一个封闭生命周期。该 authority 固定 target PeerId、deadline、cancel 与唯一 winner;迟到或失败的 completion 不会污染现有连接。

范围

  • 用 generation-scoped attempt authority 约束 native dial。
  • 最多提交一个已认证 winner。
  • cancel、timeout 或 replacement 时回收 child task。
  • 保持既有 QUIC/DCUtR 与获批成员转发行为不变。
  • 只增加少量 winner/cancel 高价值测试。

这是 #4382 的第 1/4 层;本 PR 不加入 WebRTC 行为或 UI。

验证

  • cargo fmt --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented and verified the bounded attempt lifecycle under human direction. The human contributor owns review and merge decisions.

Checklist

  • Tests cover the decision-relevant behavior
  • Formatting, lint, and affected tests pass locally

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Aug 31, 2026
@M4n5ter
M4n5ter marked this pull request as ready for review September 1, 2026 00:00
@github-actions github-actions Bot added effort/M Under 500 readable lines and removed effort/S Under 100 readable lines labels Sep 1, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at exact head 602cbb89a11f13879b8ddbb167c2816e17d11118 at the explicit direction of M4n5ter. No technical review was performed as part of this action; M4n5ter requested the approval and accepts responsibility for subsequent handling.


Review notice: This approval was submitted by an automated review agent operated by WAWQAQ and is published at the direction of M4n5ter, who requested this action and is the human accountable for it.

@M4n5ter
M4n5ter merged commit 9493109 into main Sep 1, 2026
19 checks passed
@M4n5ter
M4n5ter deleted the refactor/runtime-host-peer-attempt-lifecycle branch September 1, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants