Skip to content

fleet(proxy): fail-fast (≤2s) transport, single-flight recovery, stamped broker start (#5758) - #6490

Merged
dezren39 merged 5 commits into
mainfrom
queue/10968-5758-fleet-proxy-recovery
Nov 6, 2026
Merged

dezren39 merged 5 commits into
mainfrom
queue/10968-5758-fleet-proxy-recovery

Conversation

@dezren39

@dezren39 dezren39 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Closes the code slice of #5758 (task 10968): bound fleet-proxy recovery and stamp broker starts.

What changed

  • Fail-fast transport (tunnel.rs): connect_tunnel now runs under a total 2s TRANSPORT_DEADLINE — TCP connect via connect_timeout per resolved address, and the CONNECT handshake re-arms its read timeout to the remaining budget on every byte, so a silent/trickling peer cannot stretch setup. The deadline bounds setup only: an established tunnel keeps the 660s read timeout (daemon exec allowance) unchanged.
  • Single-flight recovery (serve.rs): every tunnel open goes through a per-port RecoveryGate — exactly one CONNECT in flight per port; concurrent callers wait (bounded) and, if that attempt failed, fail fast with its error instead of stampeding; on success they open serialized. Concurrent-open count peaks at 1 in tests.
  • Stamped broker start (serve.rs): the first line a starting broker writes is <ISO-8601 UTC> fleet proxy serve start implementation=fleet-proxy version=<crate> pool_size=<n> pid=<pid> socket=<path> — no credentials. Pool default stays 50; keepalive 180s and idle exit 3600s untouched.
  • Deterministic owner (fleet-queue client.rs): the existing sibling-fleet selection in broker_program is factored into the pure, testable broker_program_in(dir); tests pin that a sibling fleet binary always wins over the Python broker spawn, and Python remains only for standalone builds with no sibling.

Tests (oracle: the packet acceptance for task 10968)

  • Fault injection: silent CONNECT peer fails within the 200ms test deadline (was a 60s hang); refused direct target fails within the 2s deadline; constants pin setup=2s vs established=660s.
  • Concurrency: 8 concurrent failing recoveries run exactly 1 attempt and all share its error; 4 successful opens serialize (peak in-flight 1).
  • Startup line: UTC formatter pinned (epoch, leap day), line carries implementation/version/pool_size/pid/socket; DEFAULT_POOL_SIZE still 50.
  • cargo test -p fleet-proxy — 52 passed; cargo test -p fleet-queue --features client — broker-program tests pass (21 in the filtered client run).

Out of scope (per packet)

Multiplexed transport (#5756), round-trip coalescing (#5757), pool/keepalive/idle policy changes, laptop-agent.py (not tracked here).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 6, 2026 09:57
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ee83805-7315-4207-8400-de29eabf3303
Commits

Reviewing files that changed from the base of the PR and between 49797df and ddef62e.

Files selected for processing: 4

  • pkgs/fleet/crates/fleet-proxy/src/serve.rs
  • pkgs/fleet/crates/fleet-proxy/src/tunnel.rs
  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/smoke.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 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-11-06T10:24:33.870476Z ddef62e New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5dedc35698

ℹ️ 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".

…rent, waiters keep their generation verdict (#5758, PR #6490 Codex P1+P2)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5af36206dc

ℹ️ 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8242f6acc8

ℹ️ 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".

… asserts the stamped startup line (#5758, PR #6490 Codex round 3)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7eb4bbed99

ℹ️ 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".

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