Skip to content

feat: add rem_unregistered_confirm_minutes dwell timer - #1360

Open
bakerboy448 wants to merge 2 commits into
developfrom
feat/rem-unregistered-confirm-minutes
Open

feat: add rem_unregistered_confirm_minutes dwell timer#1360
bakerboy448 wants to merge 2 commits into
developfrom
feat/rem-unregistered-confirm-minutes

Conversation

@bakerboy448

@bakerboy448 bakerboy448 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds an optional dwell timer to rem_unregistered that protects against a tracker transiently reporting "unregistered"/"not found" during an outage — a healthy torrent should not be deleted on a single bad tracker response.

Depends on #1359 (the detection bug fix). The dwell logic lives inside the same process_torrent_issues code path the bug fix restructures, so this PR currently includes the #1359 commit as well. Please merge #1359 first; once it lands on develop this PR's diff collapses to the feature commit only. Review only the feat: commit here.

Relates to #1358

What changed

  • New setting rem_unregistered_confirm_minutes (int, default 0 = off, no behavior change by default). When > 0, the first time a torrent is seen unregistered it is tagged unregistered_tag (default unregisteredCheck) with a timestamp; it is only removed on a later run once it has stayed unregistered for at least that many minutes.
  • Set it above your tracker announce interval so a tracker that momentarily returns "unregistered"/"not found" during an outage doesn't cause a deletion before the tracker re-announces.
  • The flag is cleared as soon as the torrent recovers (a working tracker, or no longer reporting unregistered).
  • Fail-safe: a marker whose timestamp is unparseable (e.g. hand-edited) is ignored, so it can never short-circuit the dwell into an immediate deletion.
  • New setting unregistered_tag (default unregisteredCheck) for the marker name; added to default_ignore_tags.

Documented in Config-Setup.md and config.yml.sample. Note: dry-run never writes the flag, so it can't simulate the second-pass removal.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have modified this PR to merge to the develop branch

Tests

Added coverage in tests/core/test_remove_unregistered.py: first-sighting flags (no delete), delete after dwell elapsed, waits when dwell not elapsed, confirm_minutes=0 immediate delete, malformed-marker fail-safe, and flag clearing on recovery (both in-process and via remove_previous_errors). Full suite green.

process_torrent_issues only evaluated the last entry in a torrent's
tracker list, so an "unregistered" tracker followed by another failing
tracker (or a trailing DHT/PeX/LSD pseudo-entry) was never detected.
Scan all failing trackers for an unregistered message instead of only
the last one.

Removal now acts only when no tracker is WORKING and none is still
UPDATING / NOT_CONTACTED (inconclusive, self-resolving states), so a
deletion is never decided on incomplete tracker state.
Add an optional dwell timer for rem_unregistered (default 0 = off). The
first time a torrent is seen unregistered it is tagged with
unregistered_tag plus a timestamp; it is only removed on a later run once
it has stayed unregistered for that many minutes. Set it above your
tracker announce interval to avoid removing a healthy torrent when a
tracker transiently reports "unregistered"/"not found" during an outage.

The flag is cleared as soon as the torrent recovers (a working tracker or
no longer reporting unregistered). A marker whose timestamp is unparseable
(e.g. hand-edited) is ignored, so a malformed tag can never short-circuit
the dwell window into an immediate deletion.

New settings: rem_unregistered_confirm_minutes (int, default 0) and
unregistered_tag (default unregisteredCheck).
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Pull requests that update Python code labels Aug 18, 2026
@bakerboy448
bakerboy448 changed the base branch from fix/1358-unregistered-multi-tracker to develop August 18, 2026 02:15
@bakerboy448 bakerboy448 reopened this Aug 18, 2026
@bakerboy448
bakerboy448 requested a review from bobokun August 18, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant