Wire bounded scrape commands into active torrent sessions - #226
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62ed289742
ℹ️ 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".
| val lease = exchangeBudgets.metadata.reserve(64 * 1024 * 17) | ||
| ?: return@scrape false |
There was a problem hiding this comment.
Size scrape reservations for valid metadata budgets
When TorrentConfig.maxMetadataBytes is below 208 KiB (for example, a valid 64 KiB limit), the metadata partition has only maxMetadataBytes * 4 + 256 KiB, so this fixed 1,114,112-byte reservation can never succeed. Consequently every scrapeTracker() call silently returns false for those supported configurations without issuing I/O; either guarantee enough metadata-pool capacity in configuration validation or derive the scrape reservation so it fits the independently bounded 64 KiB response.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 584e0cc. The metadata exchange partition now has a shared scrape-workspace floor independent of maxMetadataBytes, and aggregate configuration validation includes that floor. The live session regression now uses a valid 64 KiB metadata limit: it failed before the fix and passes afterward. The combined child stack passes 605 JVM tests, 584 executed iOS simulator tests, the native-runtime guard, and both existing v1 conformance scenarios.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Active torrent sessions can now request tracker scrape through their existing command owner. Requests contact only the current announce tracker, share bounded manual admission and serialized lifecycle ownership, and apply a 60-second cooldown even after failure or cancellation. Tracker estimates appear in credential-free status snapshots and never affect local progress or peer authorization.
The engine reserves response-decoding workspace before I/O, and session admission covers the added estimates and cooldown state. Missing results clear estimates; tracker replacement requires a new successful announce.
Stacked on #225 for #162. Validation: full JVM and executed iOS simulator suites, native-runtime guard, two existing Transmission v1 conformance scenarios, live engine scrape routing, failure/cancellation cooldowns, replacement, and shared command cleanup. Public controller/remote commands and durable throttling across restarts remain roadmap work.