Repository navigation
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44287443df
ℹ️ 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".
| peers.forEach { output.send(it) } | ||
| } | ||
| delay(1000) | ||
| TrackerControl.run(exchangeBudgets.sessions, operation = { manual -> |
There was a problem hiding this comment.
Reserve tracker-control memory during session admission
When maxSessionStateBytes is exactly the accepted sessionStateWeight(spec)—a configuration explicitly exercised by the admission tests—the session lease consumes the entire budget, so this additional reservation fails whenever the torrent has trackers. Because the failure occurs in the supervised tracker-discovery child after addTask succeeds, a private or DHT-disabled torrent remains running without ever contacting its only peer source. Include this control charge in admission or reserve it atomically with the session lease.
AGENTS.md reference: AGENTS.md:L162-L165
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0630367. sessionStateWeight now includes the tracker-control allowance, and each session uses a bounded control pool backed by that existing lease rather than reserving twice from the shared partition. The live engine regression runs at exactly sessionStateWeight(spec), contacts its tracker, exercises manual reannounce and pause/resume, and releases admission on stop. It failed before the fix and passes afterward; the combined stack passed 559 JVM and 538 executed iOS tests.
| } finally { | ||
| checkNotNull(publishStatus).invoke(checkNotNull(readStatus).invoke()) |
There was a problem hiding this comment.
Publish tracker status while an announce is in flight
For a slow or stalled tracker request, TrackerTiers.announce changes the record to ANNOUNCING before suspending, but this callback runs only in finally, after the request has succeeded, failed, or been canceled and the status has already changed again. Consequently the newly exposed session trackerStatus flow can never emit ANNOUNCING and remains empty or stale throughout an in-flight request; publish the snapshot when the attempt enters that state as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0630367. TrackerTiers now publishes status transitions through an observer, including ANNOUNCING before network suspension, and the live engine attaches/detaches that observer with discovery. The integration regression holds the HTTP reply until ANNOUNCING is observed; a separate test covers transition snapshots and configuration revision changes. Combined validation passed 559 JVM and 538 executed iOS tests.
|
Superseded by #237 (Tracker lifecycle, editing and discovery privacy) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Connects internal manual reannounce and tracker status flows to running Kotlin torrent sessions. Periodic and manual discovery share a lock; only one manual operation may be outstanding. Discovery owns manual jobs, and cancellation/shutdown joins cleanup before releasing reserved session-state credit. Automatic and manual responses share peer authorization/publication.
Pause detaches the control and clears status; resume installs a fresh control. A real engine test verifies HTTP tracker events, throttling, pause/resume, and final admission release. Deterministic tests cover bounded requests, serialization, caller cancellation, owner shutdown, and insufficient budget.
Stacked on #216; advances #162. SDK/daemon/UI exposure, tracker-edit persistence across pause/resume, and public v2 session registration remain separate work.
Validation at
44287443dfecd2dfcabe43ed605d6a2df1226545: 553 JVM and 532 executed iOS simulator tests, zero failures/errors/skips; native-runtime guard and both pinned v1 conformance scenarios passed.