Skip to content

fleet(#5757): exponential poll backoff 1s doubling capped at 10s - #12948

Open
dezren39 wants to merge 1 commit into
mainfrom
oc-code-08/5757-poll-backoff
Open

dezren39 wants to merge 1 commit into
mainfrom
oc-code-08/5757-poll-backoff

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Poll slept a fixed 3s between status requests (client.rs:471). Long jobs pay one round trip per 3s window. This slice adds poll_interval() (1/2/4/8s doubling, 10s cap) and wires it into poll(), first step toward the #5757 acceptance (poll trips reduced >=5x at detection latency <=10s). Server-side long-poll (?wait_s) stays a follow-up slice.

Evidence

  • Before: poll_interval stub returned fixed 3s; new test poll_interval_starts_at_1s_doubles_and_caps_at_10s_5757 FAILED (left 3s, right 1s).
  • After: cargo test -p fleet-laptop-agent --lib in pkgs/fleet — 21 passed, 0 failed (includes 2 new tests).
  • Math: a 60s job costs sleeps 1+2+4+8+10+10+10+10+5 = ~9 trips instead of ~20 fixed-3s trips (~2.2x from backoff alone; long-poll follow-up gets the rest).
  • Ran in worktree on laptop; no new test file so no registry row needed.

Merge Danger

Low: poll timing only, no protocol change. Worst case is slower job-completion detection (bounded at 10s by the cap test). Python laptop-agent.py:1469 still sleeps fixed 3s — mirrored follow-up, not this PR.
Closes nothing yet; progress toward #5757 criterion 4.


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

Poll slept a fixed 3s between status requests. Long jobs pay one
round trip per 3s window; the #5757 census targets >=5x fewer poll
trips at detection latency <=10s. poll_interval() doubles 1/2/4/8s
then caps at 10s; poll() sleeps min(remaining, interval).

Oracle: specified sequence 1,2,4,8,10,10... plus monotonicity and
the 10s cap (unit tests, no daemon needed).

After this PR: a 60s job costs ~9 poll trips instead of ~20.
Server-side long-poll (?wait_s) stays a follow-up slice.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 05:44
@coderabbitai

coderabbitai Bot commented Nov 23, 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 58 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: 9a6ec7a3-fa54-401c-959d-eaa639db6d91
Commits

Reviewing files that changed from the base of the PR and between 4733a59 and 713610d.

Files selected for processing: 1

  • pkgs/fleet/crates/fleet-laptop-agent/src/client.rs
  • 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 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T05:46:02.845902Z 713610d 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.

This branch has not been deployed

No deployments
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