Skip to content

feat(torrent): seed waiting torrents as soon as a seeder stops - #674

Merged
linroid merged 1 commit into
mainfrom
feat/torrent-seed-queue
Nov 14, 2026
Merged

linroid merged 1 commit into
mainfrom
feat/torrent-seed-queue

Conversation

@linroid

@linroid linroid commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Stacked on the file priority PR; only the last commit belongs to this PR.

What

The "Seeding: a seed queue" row of #162.

A finished torrent that was meant to seed but found every engine slot taken kept its intent and then waited for the next start, or for sharing to be switched off and on. It now starts, oldest completion first, as soon as a seeder is told to stop or reaches a seed goal, so with a ratio or time goal a backlog seeds in turn.

TorrentControls walks the waiting tasks again from the Stop command's seedingStopped hook, one walk at a time. It deliberately does not walk on every completion event: Ketch also reports those for restored tasks and for each change of what a completed task shows, which made a first attempt retry tasks that cannot seed over and over (caught by SeedingWatcherTest).

Testing

TorrentSeedingControlTest.queue_seederToldToStop_handsItsSlotToTheNextTaskMeantToSeed against a real engine with one slot; the seeding suites (SeedingWatcherTest, TorrentSourceSeedingTest, KetchTorrentControllerTest) pass.

Not covered here: a slot freed by a download that is paused, fails or is removed does not start a waiting seeder until the next of the events above.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T05:07:34.312914Z 7e426f6 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.

@claude

claude Bot commented Nov 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 2 298 files  ±0   2 326 suites  ±0   57m 41s ⏱️ - 1m 55s
16 284 tests +3  15 999 ✅ +3  285 💤 ±0  0 ❌ ±0 
19 823 runs  +5  19 538 ✅ +5  285 💤 ±0  0 ❌ ±0 

Results for commit a23006c. ± Comparison against base commit 33b8fd9.

♻️ This comment has been updated with latest results.

@linroid
linroid force-pushed the feat/torrent-seed-queue branch 2 times, most recently from 82fb49c to d18bc57 Compare November 14, 2026 12:28
Base automatically changed from feat/torrent-file-priority to main November 14, 2026 12:32
@linroid
linroid force-pushed the feat/torrent-seed-queue branch from d18bc57 to a23006c Compare November 14, 2026 12:32
@linroid
linroid merged commit 9d97000 into main Nov 14, 2026
14 checks passed
@linroid
linroid deleted the feat/torrent-seed-queue branch November 14, 2026 13:11
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