Skip to content

docs(issues): add spec for scrape ignoring persisted torrent downloads - #2408

Merged
josecelano merged 3 commits into
torrust:developfrom
josecelano:2406-scrape-ignores-persisted-torrent-downloads-spec
Oct 2, 2026
Merged

josecelano merged 3 commits into
torrust:developfrom
josecelano:2406-scrape-ignores-persisted-torrent-downloads-spec

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

Adds the issue specification for the bug where HTTP and UDP scrape report zero downloads for a torrent after a tracker restart, even though persistence (persistent_torrent_completed_stat) saved its completion count. Announce lazily restores the persisted count; scrape only reads the in-memory swarm.

This is a spec-only PR. Implementation (red regression test, fix, green, like-for-like recheck) follows in a separate PR on the 2406-scrape-ignores-persisted-torrent-downloads branch after this merges.

Files

  • docs/issues/open/2406-scrape-ignores-persisted-torrent-downloads/ISSUE.md: bug specification, scope, Option A/B design choice (read-only vs. cache a peerless swarm, maintainer preference B), regression-test strategy, plan, and acceptance criteria.
  • docs/issues/open/2406-scrape-ignores-persisted-torrent-downloads/manual-verification-evidence.md: V1 pre-fix reproduction.

Validation

  • Reproduced against a local SQLite-backed tracker: before restart a UDP scrape reported completed: 1; after a clean restart and before any announce, HTTP reported downloaded: 0 and UDP reported completed: 0. Commands and output are in the evidence file.
  • Pre-commit checks pass, including linter all and staged frontmatter validation.

Context

Found during the #1488 SI-22 shutdown work and handed off to be fixed independently, ahead of SI-22.

Related to #2406

Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:42

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The evidence does not verify the persisted database value, and the specification contradicts the PR’s spec-only workflow.

Review effort: Balanced
Findings: 4 Low severity

Open (4)
What changed in this PR

Adds the specification and pre-fix evidence for persisted torrent download counts being lost from scrape responses after restart.

Changes:

  • Documents design options, implementation plan, tests, and acceptance criteria.
  • Records SQLite-backed HTTP/UDP reproduction evidence.
File Description
ISSUE.md Defines bug scope, design, and verification plan.
manual-verification-evidence.md Records the pre-fix reproduction.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@josecelano josecelano self-assigned this Oct 2, 2026
@josecelano
josecelano force-pushed the 2406-scrape-ignores-persisted-torrent-downloads-spec branch from 83a1f6c to 5b254f4 Compare October 2, 2026 13:37
@josecelano

Copy link
Copy Markdown
Member Author

ACK 1efb4ff

@josecelano
josecelano merged commit 620d26a into torrust:develop Oct 2, 2026
1 check passed
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