Skip to content

Let the local runner rent while a peer is asleep - #68

Merged
lydakis merged 2 commits into
mainfrom
claude/errand-supplier-deadline
Oct 7, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/errand-supplier-deadline

Conversation

@lydakis

@lydakis lydakis commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Before: since #67, --where gpu on a laptop whose runner has cloud offers fails whenever one of your peers is asleep: no runner matches "gpu": asleep: context deadline exceeded; local: probe deadline exceeded. The peer's probe uses the whole 2 s deadline, and the local runner is asked only after it, so it gets no time.

After: the laptop rents even with sleeping peers, a hung local runner never delays a runner of yours that matches, and selection still takes at most about 2 s.

How: chooseRunners sets one 2 s deadline. Lease suppliers (the runner installed here) are probed in their own probeCandidates call, started at the same time as the candidates, so hung peers can't use up their time or their probe slots. Their answers are awaited only when renting is needed. Otherwise the deadline's cancel ends them, and they are never a job target. --where '*', which never rents, skips them. The cost is one local socket probe running in parallel, only for users whose installed runner has cloud offers.

Tests: TestSupplierProbeSharesSelectionDeadline covers four cases:

  • Everything hangs: the selection takes about 2 s.
  • One peer hangs and the local runner answers: it rents. This fails on main.
  • Thirteen peers hang: the local runner still rents.
  • The local runner hangs while a runner of yours matches: the selection returns at once. This took 2 s on the previous head.

TestLocalCloudPeerOnlySuppliesLeases checks that the local runner is never chosen. go test -race ./cmd/errand/ ./internal/config/ (and -count=3 on the placement tests) and go vet pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6

#67 put the local supplier's probe under the candidates' deadline, but it
still ran after them, so whenever a peer hung until the deadline the local
runner got no time and --where could not rent while any peer was asleep.
Suppliers are now probed in the same call as the candidates, first so the
fan-out limit never holds them back, and their answers are used only when
renting. The bare wildcard skips them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6

lydakis commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@codex security review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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: 112ef4909b

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

Comment thread cmd/errand/placement.go Outdated
Comment thread cmd/errand/placement.go Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-10-07T08:03:27.067828Z 4847cc9 Manual request
ℹ️ 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.

Suppliers shared the candidates' fan-out slots, so enough hung peers could
still keep the local runner from being asked, and a hung local runner
delayed every placement until the deadline, even when one of your runners
matched at once. Suppliers now get their own probe call, started with the
candidates under the same deadline, and are awaited only when renting;
otherwise the deadline's cancel ends them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6

lydakis commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 4847cc9e34

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

@lydakis
lydakis marked this pull request as ready for review October 7, 2026 03:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@lydakis
lydakis merged commit 59e42db into main Oct 7, 2026
8 checks passed
@lydakis
lydakis deleted the claude/errand-supplier-deadline branch October 7, 2026 03:21

lydakis commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

@codex security review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 59e42db754

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

2 participants